- Introduction
- Events
- Keyboard events
- Frame events (frame actions)
- Targets
- Actions
Frame events (frame actions)
Whereas user interaction triggers mouse and keyboard events, the timeline triggers frame events, which are also known as frame actions because they are attached to frames and always trigger an action.
Frame eventswhich are always placed at keyframesare useful for actions that you want to occur at certain points in time. For example, a Stop action will cause your movie to halt, and a Go To action will cause your movie to jump to another frame or scene on the timeline.
To create a frame event that triggers an action:
-
Double-click the keyframe where you would like the frame event to occur.
The Frame Properties dialog box appears.
-
Click the Action tab.
-
Click the plus sign ("+") to assign an action or actions that you want triggered when the timeline reaches this keyframe.
-
For our demonstration, choose the Stop action, which will cause your movie to stop playing.
The Actions pane displays your completed ActionScript. Notice that even though this is the same action that was assigned to the mouse event we configured earlier, the script is different: It lacks the On (Release) and End On statements, which are only required to define mouse or keyboard events (because both can take so many forms). A frame event can only be triggered one wayby the timeline reaching that frame.
-
Click OK.
When the movie is played, it will perform the action when the timeline reaches this keyframe.