In flex when we key in something like this:
<s:Image id="pic" source="image/a.jpg" smooth="true"/>
<s:Image id="pic2" source="image/b.jpg" smooth="true"/>
The pic2 will be on top of pic. How can I have pic on top of pic 2? I have tried using swap element (this.swapChildren(pic,pic2)), but it doesn't work. Any help is very appreciated. Thanks.
Create a method like below and use that:-
protected function yourSwap():void
var topLevelChildrenIndex : int = yourContainer.numChildren -1;
Here your 'yourContainer' is the id of the component the children of which you want to swap.In your requirement this is the id of the container which is having your images.
Hope this will help.