situation | |
How to bring to front an object of the same container front of someone else (of the same container)? The easiest wait it to change the “depth” property of to object. WRONG! In the meanwhile it should work! | |
problem | |
adobe flex AS3.0, how to bringToFront an object on a container? The depth… doesn't matter! --- > dn |
difficulty level | |
3/10 :| | |
compatibility | |
flex 4.0 | |
solution |
public static function bringToFrontWithApplicationHost(container:Application,displayObjectToBringToFront:IVisualElement):void{
container.swapElements(container.getElementAt(container.numElements-1),displayObjectToBringToFront);
}
public static function bringToFrontHostWithContainerHost(container:Container,displayObjectToBringToFront:IVisualElement):void{
container.swapElements(container.getElementAt(container.numElements-1),displayObjectToBringToFront);
}
or use what ever you want... they do the same
public static function bringToFrontWithApplicationHost2(container:Application,displayObjectToBringToFront:IVisualElement):void{
container.removeElement(displayObjectToBringToFront);container.addElement(displayObjectToBringToFront);
}
public static function bringToFrontHostWithContainerHost2(container:Container,displayObjectToBringToFront:IVisualElement):void{
container.removeElement(displayObjectToBringToFront);container.addElement(displayObjectToBringToFront);
}
No comments:
Post a Comment