topical media & game development

talk show tell print

professional-flex-code-18-CreationIndexExample.mx

professional-flex-code-18-CreationIndexExample.mx [swf] flex


  <?xml version="1.0" encoding="utf-8"?>
  <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
    <mx:Script>
      <![CDATA[
        private function traceEventHandler(event:Event):void 
        {
          trace(event.target.id +" has been created");
        }
      ]]>
    </mx:Script>
    <mx:HBox>
      <mx:HBox id="box1" 
        creationPolicy="queued" 
        creationIndex="3" 
        backgroundColor="0xFF0000" 
        width="100" height="100" 
        horizontalAlign="center" 
        verticalAlign="middle"
        creationComplete="traceEventHandler(event);">
        <mx:Text color="0xFFFFFF" text="1" fontSize="30" />
      </mx:HBox>
      <mx:HBox id="box2" 
        creationPolicy="queued" 
        creationIndex="2" 
        backgroundColor="0x0000FF" 
        width="100" height="100" 
        horizontalAlign="center" 
        verticalAlign="middle"
        creationComplete="traceEventHandler(event);">
        <mx:Text color="0xFFFFFF" text="2" fontSize="30" />
      </mx:HBox>
      <mx:HBox id="box3" 
        creationPolicy="queued" 
        creationIndex="1" 
        backgroundColor="0x00FF00" 
        width="100" height="100" 
        horizontalAlign="center" 
        verticalAlign="middle"
        creationComplete="traceEventHandler(event);">
        <mx:Text color="0xFFFFFF" text="3" fontSize="30" />
      </mx:HBox>
    </mx:HBox>
  </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.