This content has been marked as final. Show 4 replies
You do mean during runtime using ActionScript, right? If so, you don't. You can't reparent a clip. (I hear it is coming with the next version of Actionscript.)
More importantly why do you want to? There is probably a solution for what you are doing.
You could export the symbol for Actionscript. Take the instance in box1, copy all its properties, remove/delete/unload the orginal, attachMovie, apply properties.
yeah, i want to move it at runtime...
I'm already doing the thing where i copy all the properties, but it's causing a huge memory leak because the movieclips have objects within objects. What I did was used attachMovie and then copied all the stuff using 'for(var i in mc)' and it would freeze very quickly.
so I made a loop the rules out anything that's an instance of object or of Function. This process works, but it kinda sucks. also, my for loop doesn't rule in any of the _properties (eg. _x, _yscale, _alpha, etc...). I just wanted to know if there's a more efficient way...
duplicateMovieClip didn't work either because it makes a copy under the same parent... bah!
Why are you trying to move it to a different parent? There really is little reason to do this. Whatever it is that you are trying to do can probably be done easier if you just think about the problem differently. Really.
I did think about it.
Part of the way object oriented languages work is that you can move objects to different parents when needed. However, the movieclip object can't be moved at run time because of it's run time usage.
For example, if you have a deck of cards, you would put 52 card objects inside of a deck object. Then you can pass the card objects to the player objects and to the 'table' object. But if the card is always visible on the stage, it's harder to do this because you can't change a movieclips location. Sure you can use wannabe pointers, but then you get screwed on movie depths because of parent movie clips.
All in all, it's a huge mess and it should be easier, hence why I tried to use the forums.