ActionScript 2 (AS2) variables store values for use in the Flash movie scripts. They can contain any type of data. There are three scopes of AS variables: timeline, global or local. Global variables are accessible from anywhere in your movie currently loaded into the Flash Player. You can set the variable in one frame, and it will hold its contents in another frame. You need to assign a value to the variable to set a global variable in AS2 script.
- Skill level:
Click the "Start" button and select "Macromedia Flash MX" to open the Flash MX application.
Click "File" and "Open." Open your ActionScript panel and select the ActionScript where you want to set the global variable.
Add the following code after the "function" line in your ActionScript to create the "traceSlide" global variable and assign it the value 5:
Add the following code after "end" line in your ActionScript to assign a global variable to the "sequence" function:
Click "File" and "Save" to save your global variable in your ActionScript.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for