[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How do I call the WindowedApplication exit function from a panel in a Flex 4 AIR application?

Posted on 2011-03-04
5
Medium Priority
?
872 Views
Last Modified: 2012-05-11

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 ;

Open in new window


and an event handler for the close button....

protected function exitButton_clickHandler(event:MouseEvent):void
{
    controllerWindow.exit() ;
}

Open in new window


....but I can't figure out how to initialise the controllerWindow variable in the WindowedApplication MXML file.
0
Comment
Question by:sunnystar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
deepanjandas earned 2000 total points
ID: 35044228
Try this static API:

NativeApplication.nativeApplication.exit();


Warm Regards
Deepanjan Das
0
 

Author Closing Comment

by:sunnystar
ID: 35057493
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.
0
 
LVL 17

Expert Comment

by:deepanjandas
ID: 35057543
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
0
 

Author Comment

by:sunnystar
ID: 35073487
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.

i.e. as a parameter in...
<panels:SPanel3 id="thebody" controllerWindow="????"/>

Open in new window


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.

Rishi

0
 
LVL 17

Expert Comment

by:deepanjandas
ID: 35077427
Actually I have never tried to pass the application instance like this, rather I have used the static APIs in these cases :)

Warm Regards
Deepanjan Das
0

Featured Post

Are You Ready for GDPR?

With the GDPR deadline set for May 25, 2018, many organizations are ill-prepared due to uncertainty about the criteria for compliance. According to a recent WatchGuard survey, a staggering 37% of respondents don't even know if their organization needs to comply with GDPR. Do you?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question