How do I call the WindowedApplication exit function from a panel in a Flex 4 AIR application?
I have a WindowedApplication with a panel. The Panel has a close button attached to it that when clicked should close the application. I was thinking of doing this by having a var in the Panel
private var controllerWindow : WindowedApplication ;
Great in that the end result of what I want to achieve is captured. Would perhaps be nice to know how an application could pass itself to a subpanel.
deepanjandas
I am not sure if I understand your next question correctly - try using NativeApplication.nativeApplication to get hold of the application.
Warm Regards
Deepanjan Das
sunnystar
ASKER
Hi Deepanjan,
Yeah, thanks for that.
I guess conceptually I was interested in how the 'this' object (in this case the WindowedApplication) can be passed as a parameter to the method of another object (i.e. the Panel) in an MXML file.
Though now I think about it I guess this kind of thing could be done in the creationComplete event handler as the 'this' keyword works in the fx:Script section.