views:

318

answers:

1

I want to detach a movieclip and attach it elsewhere, but it doesn't seem possible in AS2.

I'm looking for an AS2 equivalent of Cocoa's addSubview/removeFromSuperview.

Is there alternatives routes to go, such as duplicating a movie with a new parent.. is that possible?

+4  A: 

As far as I remember, you cannot do this.

AS2 bears this serious shortcoming, and if you use AS3, it's a lot simpler, because the graphics are not so directly tied to the object, so you can remove a child without destroying it and then reattach it to another displayObject.

but, if you're stuck using as2...

What I've done in the past is cached the mc in question as a bitmap, but that only works if all you need is the "screenshot" of the mc.

Another way of dealing with this is not attaching stuff inside the FLA, but creating a class that can hold your "vitals" if you need any like current frame or position of mcs within. then you transfer these values from an old mc to the newly generated one, and destroy the old one.

Daniel