Declaring stage instances from Library

1. Uncheck “Publish settings->AS3->Automatically declare stage instances”;

2. Right click Sprite/MovieClip in Library. Check “Linkage”, assign”Class”and “Base class”. I think the base class is either “Sprite” or “MovieClip”;

3. Declare instance as a property of the Document class. The class must be declared as public in order not to get a compiler error. Like so:

public var bkgdrop:Backdrop;

or

public var bkgdrop:Sprite;

Links:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: