topical media & game development

talk show tell print

professional-flex-code-07-ToolTips1.mx

professional-flex-code-07-ToolTips1.mx [swf] flex


  <?xml version="1.0" encoding="utf-8"?>
  <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
          creationComplete="initApp()">
  
          <mx:Script>
                  <![CDATA[
                          import mx.core.IToolTip;
                          import mx.events.ToolTipEvent;
                          
                          import mx.controls.TextInput;
                          
                          private function initApp():void
                          {
                                  myTextInput.addEventListener(ToolTipEvent.TOOL_TIP_SHOW, onToolTip);
                          }
                          
                          private function onToolTip(event:ToolTipEvent):void
                          {
                                  var toolTip:IToolTip = event.toolTip;
                                  myLabel.text = toolTip.text;
                          }
                          
                  ]]>
          </mx:Script>
          
          <mx:TextInput id="myTextInput" toolTip="ToolTip text goes here" />
          <mx:Label id="myLabel" />
          
  </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.