1
votes

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?

1
separate movieclip is not the same as a clone of movieclip:)Lukasz 'Severiaan' Grela

1 Answers

2
votes

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;
    }
}