FLEX

Hagi 2009. 11. 7. 13:08

 <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="sijakHandler(event)">
 <mx:Script>
  <![CDATA[
   import mx.controls.Alert;
   
   private function sijakHandler(event:Event):void{
    button.addEventListener(MouseEvent.CLICK, clickHandler);
   }
   private function clickHandler(event:MouseEvent):void{
    Alert.show("이벤트: "+event.type+"\n타겟: " + event.target);
   }
  ]]>
 </mx:Script>
 <mx:Button id="button"  label="누르셔!" x="261" y="131"/>
</mx:Application>

 

참고 : Programming Flex3/O'REILLY/p89