Understanding the ActionScript Language > Using actions |
![]() ![]() ![]() |
Using actions
Actions are ActionScript statements, or commands. Multiple actions assigned to the same frame or object create a script. Actions can act independently of each other, as in the following statements:
mc1.swapDepths(mc2); gotoAndPlay(15);
You can also nest actions by using one action inside another; this allows actions to affect each other. In the following example, the if
action tells the gotoAndPlay
action when to execute:
if (i >= 25) { gotoAndPlay(10); }
Actions can move the playhead in the Timeline (gotoAndPlay
), control the flow of a script by creating loops (do while
) or conditional logic (if
), or create new functions and variables (function
, setVariable
). The following table lists all ActionScript actions:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For syntax and usage examples of each action, see individual entries in the online ActionScript Dictionary in the Help menu.
Note: In this manual, the ActionScript term action is synonymous with the JavaScript term statement.
![]() ![]() ![]() |