Sep 03
These are some util functions I use to order my components on screen. They’re so simple and straightforward that maybe someone else could have written it allready. If that’s the case, please warn me: I’ll post the link here.
/*****************************/
[code lang="actionscript"] package com.util{
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
public class ObjectOrdering{
public static function bringToFront(object:DisplayObject):void{
var father:DisplayObjectContainer=DisplayObjectContainer(object.parent);
var brothers:int=father.numChildren;
father.setChildIndex(object,brothers-1);
}
public static function sendToBack(object:DisplayObject):void{
var father:DisplayObjectContainer=DisplayObjectContainer(object.parent);
father.setChildIndex(object, 0);
}
}
} [/code]




November 12th, 2008 at 9:39 pm
Thanks a lot.
February 11th, 2009 at 8:46 am
Parabenéns Gabriela,foi bem Util pra mim =)
vlw
February 12th, 2010 at 2:49 pm
Muito util, obrigado pela ajuda
Att,