topical media & game development

talk show tell print

professional-flex-code-06-EventHandling1.mx

professional-flex-code-06-EventHandling1.mx [swf] flex


  <?xml version="1.0" encoding="utf-8"?>
  <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
          
          <mx:Script>
                  <![CDATA[
                          import mx.controls.List;
                          import mx.controls.Alert;
                          
                          private function handleChangeEvent(event:Event):void
                          {
                                  Alert.show("You selected the name: " + List(event.currentTarget).selectedItem.label);
                          }
                          
                  ]]>
          </mx:Script>
          
          <mx:List change="handleChangeEvent(event)">
                  <mx:dataProvider>
                          <mx:Array>
                                  <mx:Object label="Simon Barber" />
                                  <mx:Object label="Rich Tretola" />
                                  <mx:Object label="Renaun Erikson" />
                          </mx:Array>
                  </mx:dataProvider>
          </mx:List>
  </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.