Hi,
I would like to add the same object to two different movie clips but flash wont let me…
Say I have movieclip1 and movieclip2, now I want to load an external picture and add it to both movieclips. Then the following code does not work :
var fullImageLoader:Loader = new Loader();
fullImageLoader.load(new URLRequest(imageArray[currentImage]))
var imageContainer:MovieClip = new MovieClip();
movieclip1.addChild(imageContainer);
movieclip2.addChild(imageContainer);
I found the following statement in the adobe livedocs:
*“If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container. *”
(http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html)
I have tested this and it works that way.
movieclip1.addChild(imageContainer);
movieclip2.addChild(imageContainer);
Results in the image being added to movieclip2
movieclip2.addChild(imageContainer);
movieclip1.addChild(imageContainer);
Results in the image being added to movieclip1
My question is: how I can add the ImageContainer to both movieclips and manipulate them separately ?
Thanx !