views:

271

answers:

2

I'm building a Flash CS4 application (AS3) and I can't keep all my movie clips in the library because there will be hundreds of them, and new ones will be added all the time.

Two parts to the question:

  1. How can I externally load in a movieclip to use during run time? After loading I still need to be able to manipulate it as if I created a new instance of it from the internal library.

  2. How can I load a movieclip based on its name?

Thanks!

+1  A: 

you can't load movieclips, like you know them form the library panel, at runtime (because they can't exist without a container format like .swf). but you can load other .swf files that contain those MovieClips via the Loader class. You also can create a new instance of a Class, at runtime, that extends the MovieClip Class, but i don't think this will be helpful for you, because this class would have to be inside the library as well (or at least imported with actionscript), even though you don't use it at the stage.

antpaw
+2  A: 

Look at a complete example (mixing the different concept) in the current doc

Patrick