Question

I am new to Flash, I am trying to create a class for a symbol.

I created a new Flash file, drop a DynamicText, convert this DynamicText to a Symbol called "TextBox1"

Then I created TextBox1.as in the same directory as the .fla I just created.

package
{
    import flash.display.*;

    public class TextBox1 extends MovieClip
    {

        public function TextBox1() 
        {
            trace("TextBox constructor");
        }

    }

}

I ran the Flash file but it doesn't display the message. Did I miss anything?

Was it helpful?

Solution

Did you associate the class with the symbol? Right click the symbol. Tick export for ActionScript and put TextBox1 in the class field.

OTHER TIPS

You don't need to create a blank class definition to use assets. Simply type in a class you want it to be called in Class under Linkage, and make sure the bass class is flash.display.MovieClip. When you press OK, Flash will come up with a box saying it will create a default definition for you, which is great. Now you can create instances of the class.

creating a default class http://img266.imageshack.us/img266/9799/flashwtf.png

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top