Skip to main content
Known Participant
January 12, 2011
Question

How to refer to a Class linkage set in Library from external code?

  • January 12, 2011
  • 1 reply
  • 985 views

If one uses [Embed] to refer to external graphic assets its easy to instantiate and use them.

However, I've got a png in an Fla, with the Class identifier set to "Symbols", Base class is BitmapData.

I need to instantiate it like this:

var symbols:BitmapData = new Symbols(1, 1);

addChild(new Bitmap(symbols));

Of course the compiler complains about a call to a possibly undefined method Symbols.

For a temporary fix I guess i'll put the graphic external to the swf, but for this project it needs to be in the library along with everything else.

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
January 12, 2011

If you have a symbol in your library with a Class identity of "Symbols" then you should only need to use...

var symbols:Symbols = new Symbols();

addChild(symbols);

As far as the 1,1 argumets go, are those not something you could assign when the instance is created?

kglad
Community Expert
Community Expert
January 12, 2011

(if Symbols is extends the bitmapdata class, he'll need to create a bitmap to create a displayobject.)