# Swapping Depths

**URL:** <https://forum.kirupa.com/t/swapping-depths/295271>\
**Category:** flash\
**Created:** [August 27, 2009, 1:58pm UTC](https://forum.kirupa.com/t/swapping-depths/295271 "2009-08-27T13:58:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dygfloyd](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@dygfloyd](https://forum.kirupa.com/u/dygfloyd)\
**Post date:** [August 27, 2009, 1:58pm UTC](https://forum.kirupa.com/t/swapping-depths/295271/1 "2009-08-27T13:58:06Z")

</div>

Hey everyone,

Probably got an easy one for the Flash guru’s. I need a one line way to move a movie clip to the top. I have a bunch of panels that I’ve created. When someone clicks on the panel, I want it to move to the top. This is what I have right now and it’s not working.

```auto

  private function SwitchPanels(e:Event):void
  {
   var vp:VideoPanel = e.target as VideoPanel;
   setChildIndex(vp, this.numChildren-1);
  }

```

There are convoluted ways where i add properties to the panels, blah, blah, blah. I’m looking for a one line fix. I know there’s gotta be a way to do it but I rarely run into this issue.

Let me know if anyone has any ideas.

Thanks!

Steve
