title: AS3: Element stays on stage after manipulating the index(depth)
body: <p>After I change the index of one movieclip using</p>
  
  <pre><code>oldIndex = getChildIndex(DisplayObject(e.target));
  setChildIndex(DisplayObject(e.target), numChildren - 1);
  </code></pre>
  
  <p>when I give the object its old index</p>
  
  <pre><code>setChildIndex(DisplayObject(e.target), oldIndex);
  </code></pre>
  
  <p>and go to another frame of the movie, this element I have changed the index of stays on top of all elements on the new frame.</p>
  
  <p>My question is am I doing something wrong and if not, what can I do so that this element stays only in the frame it is placed?</p>