I have an AIR app with a component that is opening a PopUpWindow via PopUpManager. The problem is, the pop up opens in the main application window, not the current active AIR window. This is I am sure because it's using FlexGlobals.topLevelApplication. SO, how do I get a reference to the current active window either via parent/owner, or some other method?
I have tried using this.parent, this.owner (and this.owner.owner.... this.parent.parent) , also have tried NativeWindow. which seems to not be available.
This is an mx datagrid component, and it is opening a popup window in actionscript from a datagrid column filter editor. So, how do you from that filter editor code open a pop up window / get a reference.
Update: I decided to create a new project for the component, and add in the Air libraries. Now I am able to access the "NativeApplication.nativeApplication.activeWindow" call. That gives me the correct Air window. However, it does not seem to be working:
PopUpManager.addPopUp(this, NativeApplication.nativeApplication.activeWindow as DisplayObject);
My popup does not appear. I am assuming because "activeWindow" is not actually a DisplayObject? (so how do I get the DisplayObject if that's the case?)
Could it be a bug still? http://jimmyflex.blogspot.com/2008/06/popupmanager-doesnt-work-in-air-windows.html