# Depth vs IDE

**URL:** <https://forum.kirupa.com/t/depth-vs-ide/324562>\
**Category:** flash\
**Created:** [August 26, 2011, 7:11pm UTC](https://forum.kirupa.com/t/depth-vs-ide/324562 "2011-08-26T19:11:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![noahssite](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@noahssite](https://forum.kirupa.com/u/noahssite)\
**Post date:** [August 26, 2011, 7:11pm UTC](https://forum.kirupa.com/t/depth-vs-ide/324562/1 "2011-08-26T19:11:50Z")

</div>

Hello,

Whenever I create a MovieClip in the IDE and draw on it with the IDE then use ActionScript to add more to it (add a Sprite, draw graphics etc…) the thing I added is always behind the graphics of the MovieClip that was drawn in the IDE. How do I bring the Sprite/Graphics that I draw/add to the MovieClip in front of the graphics that were drawn with the IDE?

I have tried doing this:

```auto

var myMC:mcDemo = new mcDemo(); //mcDemo being a MovieClip created in the IDE.
var sp:Sprite = new Sprite();
//drawing code goes here... I just don't feel like writing it now.
//along the lines of sp.graphics.beginFill() sp.graphics.drawRect sp.graphics.endFill...
myMc.addChildAt(sp,myMc.numChildren-1);
this.addChild(myMC);

```

The final product of this is the myMC movieclip on the screen with my sprite behind whatever I drew in the IDE for myMC. How do I make it so the sprite is in front of everything? I have tried setting it to numChildren-1 which should set it in front of all objects.

Thanks,  
Noah
