Always on Top

| Comments

today i found my self trying to put an Sprite on the top of the display list so here is the basic idea for solve that problem

function alwaysOnTop_handler(e:Event):void {
    //make this child always on top!
    parent.addChild(this);
}

function added_handler(e:Event):void {
    parent.addEventListener(Event.ADDED, alwaysOnTop_handler, false, 0, true);
}

addEventListener(Event.ADDED_TO_STAGE, added_handler, false, 0, true)   

cheers!

Comments