Flash can behave interactively, so that if a user clicks on a button or if the movie gets to a particular frame then a certain action is performed.  The action will be performed whenever a certain event (user click or reaching a frame) occurs. 

Actions can be inserted into frames or button symbols. An action can be inserted into the layer where interactivity will take place, or they can be inserted in their own layer.  If an action is inserted in a separate layer, the action will apply to every layer of the movie.

 

Frame Actions

Frame actions are place in a frame and when the movie reaches the frame then the action occurs.  The action could be to start or stop a sound playing, to stop the movie, to jump to a certain frame etc.

Right click on the frame where you want to add the action.  Choose Actions.  The actions panel should appear.

Click on Global Functions, then on Timeline Control.

Double click one of the actions to add it to your movie. 

It will appear in the Actions Panel.  Then choose the parameters you require for your action.

   

Stop and Play

The two most common actions are the Stop and Play actions.  The Stop action stops the whole movie playing.  Stop actions can be used to stop an animation playing continuously. 

By default Flash movies on web pages play automatically once they are loaded.  You can use a Stop action at the beginning of a movie to prevent the movie playing straight away.  (You might want to wait until the user clicks on a button before your movie starts.)

Flash movies that are stand alone movies are stopped at the beginning by default.  If you want it to play automatically, you need to insert a Play action in frame 1.

Go To

Normally frames play in sequence one after the other.  If you want to make your movie more interactive (eg in a game), then you can use Goto actions to jump to particular frames or scenes depending on the answer given.

Viewing Actions

To see your actions while in editing mode, from the menus choose  Control > Enable Simple Frame Actions.

At each point in the timeline, Flash completes the actions from the highest level frame that contains the action.  So if frame 2 of the middle layer contains an action telling the movie to goto frame 5, but frame 2 of the bottom layer has an action to goto frame 10, the movie will jump to frame 5.  The bottom layer action will never occur.

For this reason, it is usually best to put actions in their own layer.  To prevent you accidentally adding graphics to the actions layer, lock it.  Locking a layer stops you adding things to the stage, but does not stop you adding actions to frames.