Understanding ActionScript > Assigning actions to frames
Assigning actions to framesTo make a movie do something when it reaches a keyframe, you assign a frame action to the keyframe. For example, to create a loop in the Timeline between frames 20 and 10, you would add the following frame action to frame 20:
gotoAndPlay (10);
It's a good idea to place frame actions in a separate layer. Frames with actions display a small a in the Timeline.
An "a" in a keyframe indicates a frame action.
Once you've assigned an action, choose Control > Test Movie to test whether it works. Most actions won't work in Editing Mode.
The following instructions describe how to assign frame actions using the Actions panel in Normal Mode. (For information on assigning an action to a button or movie clip, see Assigning an action or method.)
To assign an action to a keyframe:
1 | Select a keyframe in the Timeline and choose Window > Actions. |
If a selected frame is not a keyframe, the action is assigned to the previous keyframe. If the selection is not a frame, or if the selection includes multiple keyframes, the Actions panel is dimmed. | |
2 | Choose Normal Mode from the pop-up menu at the upper right of the Frame Actions panel. |
3 | To assign an action, do one of the following: |
![]() |
Click the Actions folder in the Toolbox list on the left side of the Actions panel. Double-click an action to add it to the Actions list on the right side of the panel. |
![]() |
Drag an action from theToolbox list to the Actions list. |
![]() |
Click the Add (+) button and choose an action from the pop-up menu. |
![]() |
Use the keyboard shortcut listed next to each action in the pop-up menu. |
![]() |
In the Parameters fields at the bottom of the panel, select parameters for the action as needed. |
4 | To assign additional actions, select another keyframe and repeat step 3. |
![]() |
To test a frame action:
Choose Control > Test Movie.