Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 23rd, 2012  |  syntax: None  |  size: 1.41 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. 4.5 adobe builder/flex eventhandler/skinablepopupcontainer returned data empty
  2. protected function button1_clickHandler(event:MouseEvent):void
  3. {
  4.  
  5.  
  6. // Create an instance of MyAlertPopUp.
  7. var alertDB:AlertMsgPurge = new AlertMsgPurge();
  8. // Add an event handler for the close event to check for
  9. // any returned data.
  10. alertDB.addEventListener('close', alertDB_closeHandler);
  11. alertDB.open(this, true);
  12.  
  13. }
  14. private function alertDB_closeHandler(eventP:PopUpEvent):void {
  15. // If commit is false, do data is returned.
  16.  
  17. rd.text = eventP.data as String;
  18. //return;
  19.  
  20.                 /
  21. }
  22.        
  23. <?xml version="1.0" encoding="utf-8"?>
  24.     <s:SkinnablePopUpContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
  25.        xmlns:s="library://ns.adobe.com/flex/spark"
  26.        xmlns:mx="library://ns.adobe.com/flex/mx">
  27.  
  28. <fx:Script>
  29.  
  30.     <![CDATA[
  31.         // //
  32.     public function onClick(commit:Boolean):void {
  33.     close(true);                          
  34.     }
  35.     ]]>
  36. </fx:Script>
  37. <s:TitleWindow title="" x="75" y="300">
  38.  
  39.     <s:VGroup horizontalAlign="center" paddingTop="8" paddingBottom="8"    paddingLeft="8" paddingRight="8" gap="5" width="100%">
  40.         <s:Label text="Warning!! all data will be deleted"/>
  41.         <s:Button label="Yes" click="close(true);"/>
  42.         <s:Button label="No" click="close(false);"/>
  43.     </s:VGroup>
  44. </s:TitleWindow>
  45.        
  46. private function alertDB_closeHandler(eventP:PopUpEvent):void {
  47.         trace("eventdata:"+eventP.commit);
  48. }