Export Library Button Symbol for ActionScript
Flash CS4 ActionScript 3.0 Tutorial
How to Access Flash Library Symbols with ActionScript
Once you create a Symbol, it is added to the Library. ActionScript can talk to Movie Symbols or Button Symbols.
To make this happen, we must first assign the Symbol a Class Name. Once the Class is defined, we call the Class with ActionScript and assign our new object a unique variable name. There are a few rules about Class naming conventions. For more information, see topic, Class (Naming).
Movie Symbol with name GrayOval
Add a oval object to the workspace with the Oval tool (o key).
With the oval selected, press F8 to convert it to a Button Symbol (Modify > Convert to Symbol).
In the dialog box, name your symbol GrayOval and choose Button for the symbol type.
Double-click the button and add Over, Down and Hit states by pressing F6 three times.
Return to the main stage and delete the original oval object from the stage.
Open the Library (Cmd/L (PC - Ctrl/L) and select the new symbol.
Choose Properties from the Library pull-down menu.
In the Linkage section, click Export for ActionScript and a Class Name appears. Make sure you class name starts with a capital letter.
Add a new layer at the top of the stack, named Actions.
Open the ActionScript panel for your keyframe in the Actions layer by Option double-clicking (PC - Alt double-clicking) the keyframe.
Copy/Paste the following code in the ActionScript Panel:
var grayOval_btn = new GrayOval();
Test your movie by pressing Cmd/Return (PC - Ctrl/Enter).