Labs

It works in my machine!

Archive for the ‘Display List’ tag

Always on Top

with one comment

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

1
2
3
4
5
6
7
8
9
10
11
 
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!

Written by Raúl

April 21st, 2009 at 5:24 pm

Posted in AS3, General

Tagged with