Question

I am exporting my animated characters from Flash Professional as a SWF to externally load them into AS3. I do not want to export them as SWC's because I have hundreds of these characters and only a small portion of them will be used at a given time.

It seems impossible to create multiple of these character MovieClips from the same loaded SWF since they are not SWC's I have no ActionScript linkage to be able to say

var myClip:MovieClip = new MyMovieClip();

I need to be able to make separate MovieClips from this same loaded character SWF. I essentially want to be able to say

var newMovieClip:MovieClip = otherMovieClip.clone();

Can this be done?

Was it helpful?

Solution

Would you be able to try this:

var newMovieClip:MovieClip = new (otherMovieClip as Object).constructor()

or

var className:String = getQualifiedClassName(otherMovieClip);
if(className)
{
    var _class:Class = getDefinitionByName(className);
    if(_class)
    {
        newMovieClip = new _class;
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top