Replace Display Object

Hello,

I’ve been having this problem for awhile and can’t figure out an acceptable solution.

I have a MovieClip, I then assign it a display object and then add it to a displaylist. But if I want to change the graphic I can’t simply reassign it. In the following code I assign the movieclip a movieclip from the library and add it to the display list, then I try and change the graphic, but the circle stays on screen even though it is now a square.


var movieClip:MovieClip = new MovieClip()

movieClip = new Circle();

addChild(movieClip);

movieClip = new Square();

One way I’ve found to get around this is to remove the movieclip from the displaylist, reassign it, then re add it to the displaylist. This works, but then I have to reposition the movieclip again.

Does anyone know of a simple way to swap the graphics?

Thanks