Flash CS4 ActionScript 3.0 Tutorial
How to Add ActionScript to Flash Symbols
Symbols come in three flavors, Button Symbols, Movie Symbols and Graphic Symbols. It is important that you can tell the difference between symbol types because out of the three, Graphic Symbols are the only ones that can not be used with ActionScript. Each of the symbol types has a unique icon in the Library.
Adding a Symbol to the Stage
Symbols can be added by dragging them from the Library or by opening up the symbol properties in the Library and choose Export for ActionScript. For more information on Exporting for ActionScript, see topic, Export Library Movie Symbol for ActionScript.
Assigning an Instance Name
For ActionScript to talk to a Symbol, the Symbol must first be assigned an instance name. For more information, see topic, Instance Naming.
Working with Symbols
In this example we will alter a Symbol's property (alpha) with ActionScript.
Movie Symbol with instance name newMovie_mc
Add a Movie Symbol to the stage and select the symbol with the Selection tool (v key).
Open the Properties panel (Cmd/F3 (PC-Ctrl/F3)) and type in the name newMovie_mc for the Instance Name.
Add a new layer called Actions.
Option double-click (PC - Alt double-click) the keyframe in the Actions layer to open the ActionScript panel.
Copy/Paste the following code to the ActionScript panel.
newMovie_mc.alpha = .5;
Test your movie by pressing Cmd/Return (PC - Ctrl/Enter). By setting alpha equal to .5, the object's alpha value (transparency) drops to 50%.