I just wanted to mention that vars defined in the <mx:Script> of an <mx:Application> aren't global variables. They are instance variables of that application, in the same way that vars defined in the <mx:Script> of a component are instances variables of that component. If the application's vars were global variables, you could reference them from component scripts without using parentApplication.

 

- Gordon

 


From: [email protected] [mailto:[email protected]] On Behalf Of Mink, Joseph
Sent: Friday, August 26, 2005 12:33 PM
To: [email protected]
Subject: RE: [flexcoders] Handling mx.controls.Alert.show() Yes/No Options (Or A Better Way To Do It)

 

In the click event method, you could set a global variable (defined in the script section of your mxml file) to be a value that represents the pushed button...something along the lines of the following:


<mx:Application>
  <mx:Script><![CDATA[
   var pushedButton;

 

   function click (event)

   {

      pushedButton = ~buttonPushed~

   }
  ]]></mx:Script>

 

 <mx:Canvas height="480" width="640" id="mainCanvas" creationComplete="drawLines ()">

 

 </mx:Button click="click()"/>

 

</mx:Application>

 


From: [email protected] [mailto:[email protected]] On Behalf Of Matthew Kuehn
Sent: Friday, August 26, 2005 3:28 PM
To: [email protected]
Subject: [flexcoders] Handling mx.controls.Alert.show() Yes/No Options (Or A Better Way To Do It)

How does one determine which button the user clicked when showing an
alert with multiple buttons? For example:

mx.controls.Alert.show('Are you sure you want to do
that?','',mx.controls.Alert.YES | mx.controls.Alert.NO,this,'','',NO);

How do I determine if they clicked yes or no? Or, is there a preferred
way to do this? I can't seem to find any good examples.

Thanks,
Matthew





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to