# Replace Display Object

**URL:** <https://forum.kirupa.com/t/replace-display-object/230872>\
**Category:** flash\
**Created:** [June 29, 2007, 4:52pm UTC](https://forum.kirupa.com/t/replace-display-object/230872 "2007-06-29T16:52:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![warnock](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/warnock/32/3404_2.png) [@warnock](https://forum.kirupa.com/u/warnock)\
**Post date:** [June 29, 2007, 4:52pm UTC](https://forum.kirupa.com/t/replace-display-object/230872/1 "2007-06-29T16:52:42Z")

</div>

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.

```auto

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
