0
votes

I just started using the documentclass in flash... but i am already hitting problems.. I have a button inside my library that neesd to be placed on the stage I tried using

addChild (play_button);

but it didn't import it can somebody explain me how to add objects onto the stage using documentclass?

1

1 Answers

2
votes

You first need to set linkage for the library symbol, you can do that by right-clicking on the symbol in the library and choosing properties.

Next you check the "Export for ActionScript" checkbox and ensure that the "Export in frame 1" is checked as well.

You'll see a input box labeled Class. That will default to the name of the symbol, but you can change it to whatever you want. That is the class name that you can use to create an instance in your code.

Here is how you would do that :

// if the class name of your symbol in the library is play_button
var playButton:SimpleButton = new play_button;
addChild(playButton);