Swapping Depths

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.


  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