views:

35

answers:

1

Hi,

Lets suppose, there are 4 popups in my application and a viewer presses Escape once. Now i want application to close the popup which is on the top. I dont know how to accompish this because i dont know thich popup is to the front right now.

Regards Max

+2  A: 

You can check the children in the systemmanager to know what child is on top. The last child will always be the top one. If you re-order windows, the collection will be updated. At least that is what a quick test tells me.

var sm:ISystemManager = Application.application.systemManager;
var topChildIndex:int = sm.numChildren - 1;
var topChild:Object = sm.getChildAt(topChildIndex);
// do something with topChild
Christophe Herreman
Thanks, i'll try it out and let you know tonight
Max
Thanks , you are awesome :)
Max