topical media & game development

talk show tell print

professional-flex-code-14-TextInputLengthEventSample.mx

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


  <?xml version="1.0" encoding="utf-8"?>
  <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
          xmlns:comps="*"
    backgroundColor="#FFFFFF">
    <mx:Script>
      <![CDATA[
        import mx.controls.Alert;
        import flash.events.Event;
        
        // method to handle custom event
        public function lengthOf5EventHandler(eventObj:Event):void {
          mx.controls.Alert.show("Length is 5");
        } 
        public function lengthOf10EventHandler(eventObj:Event):void {
          mx.controls.Alert.show("Length is 10");
        }    
      ]]>
    </mx:Script>  
    <mx:Panel title="Text Input Length Event Sample" width="300" height="150" 
      paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"
      layout="absolute"> 
     <!--Instantiate custom class and define method to handle labelChanged event-->
     <comps:professional_flex_code_14_TextInputWithCountEvent id="myTI" myText="{myTI.text}" 
         lengthOf5Event="lengthOf5EventHandler(event);" 
         lengthOf10Event="lengthOf10EventHandler(event);" 
         horizontalCenter="0" verticalCenter="0"/>
          </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.