topical media & game development

talk show tell print

professional-flex-code-14-NonCommittingChangeEventSample.mx

professional-flex-code-14-NonCommittingChangeEventSample.mx [swf] flex


  <?xml version="1.0" encoding="utf-8"?>
  <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      backgroundColor="#FFFFFF">
      
    <mx:Script>
      <![CDATA[    
        import flash.events.Event;
        private var eventObj:Event;
            
        [Bindable(event="triggerBinding")]
        [NonCommittingChangeEvent("change")]
        private var s:String;
             
        private function triggerBinding():void{
          eventObj = new Event("triggerBinding");
                dispatchEvent(eventObj);
        }
      ]]>
    </mx:Script>
    <mx:Panel title="NonCommittingChangeEvent Sample"  width="500" height="90" 
      paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"
      layout="horizontal">  
      <mx:TextInput id="ti1" change="s=ti1.text" enter="triggerBinding()" />  
      <mx:TextInput id="ti2" text="{s}" /> 
    </mx:Panel>
  </mx:Application>
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.