views:

1342

answers:

1

Has anyone noticed how creating new instances of a MovieClip (and likely other objects as well) in AIR causes some strange effects? If you use Senocular's method by grabbing the object constructor and creating a new instance of the MovieClip, you end up with a new MovieClip with 0 frames. I don't want to draw bitmapData's of every frame into an array, does anyone have a suggestion for making a real duplicate of a MovieClip? (i.e. not just a strong reference).

+2  A: 

i'd personally use flash.utils:

getQualifiedClassName(value:*):String

and

getDefinitionByName(name:String):Object

And create an instance using the Class object

I'm sure there may be a reason why Senocular has used this method, but it may be worth trying replacing that line using these two methods to see if it solves any issues you are having.

James Hay
Hmm, that may work since that would eliminate the need to convert a MovieClip to an Object first. Thanks, I'll let you know how it goes.
Jonathan Dumaine
Nope. That didn't work. I'm still getting a 1 frame Movieclip, though it did create a new one. I can verify that the MovieClip I'm trying to copy IS on stage, but nothing is drawn in to the MovieClip. Again, this seems to be in AIR only.
Jonathan Dumaine