http://livedocs.macromedia.com/flex/2/langref/flash/display/DisplayObjectContainer.html#swapChildren()

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute">
<mx:Script>
   <![CDATA[
       private function swap():void{
           this.swapChildren(vboxRed,vboxBlue);
       }
   ]]>
</mx:Script>
   <mx:VBox id="vboxRed" backgroundColor="red" width="100" height="100"/>
   <mx:VBox id="vboxBlue" backgroundColor="blue" width="200" height="50"/>
   <mx:Button label="Swap" click="swap()" x="200" y="200"/>
</mx:Application>

There's also swapChildrenAt

On 11/30/06, elevight <[EMAIL PROTECTED]> wrote:

  Does anyone know how to control the z-axis of objects?

Here's a very short code snippet to illustrate my question:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute">
<mx:VBox id="vboxRed" backgroundColor="red" width="100"
height="100"/>
<mx:VBox id="vboxBlue" backgroundColor="blue" width="200"
height="50"/>

</mx:Application>

In the above, vboxBlue was instantiated after vboxRed, and hence,
appears on top of vboxRed. How can I, during runtime, make vboxRed be
on top of vboxBlue?

Thanks.

Reply via email to