Ok, this should be simple but like all things critical to my
flash projects they end up being hacks or major work-arounds.
Essentially, I need to add a Flash Library item (set to export as a
default class in Flash 9 Preview) - to my Flex application. I won't
go into why but just consider the need for Flash interface for
graphics creation a requirement for now. Seeing as this was no big
deal (attachMovieClip in as2) before how would i go about this in
as3/Flex? Please provide example - not just theory, if you can as
I've almost read every theory/method out there but no up to date
examples and nothing my designer brain can grasp.
Here's what im doing so far.
- Created a flash movie with a graphic movieclip set to
export on first frame / class name as default of name of movieclip
- this object doesn not live on stage but in the library (unless
the workflow needs to change but i'd rather it not as there will be
other objects to load in as well)
- Using the Image class to load in swf. All is good so far.
- So how do actualy add a child of this swf (one of the
classes compiled in this swf) to a member of my Application?
Heres what i was thinking i could do -
var myLibObject:Image = new Image();
myLibObject.source = "packages/MyLibrary.swf";
myCanvas.addChild(myLibObject.Circle); // Circle is a
library item/class in the flash library / Obviously this doesn't
work but not sure how classes within the flash document class are
This seems to work - Let's say you have a 50 or more items in
your library.swf and you want to load them all one at a time. Would
this mean that you would be loading the swf file 50 or more times
or does it load the entire swf the first time and then subsequent
calls to this swf are in flash memory?