Cast Event object for only property access : Event Object « Event « Flex






Cast Event object for only property access

Cast Event object for only property access
           
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    initialize="addListeners()">
    <mx:Script>
    private function customLogEvent(e:Event):void {
        trace(MouseEvent(e).localY + ":" + MouseEvent(e).localX);
    }
    private function addListeners():void {
        b1.addEventListener(MouseEvent.CLICK, customLogEvent);
    }
  </mx:Script>
    <mx:VBox id="vb1">
        <mx:Button id="b1" label="Click Me" />
    </mx:VBox>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Pass a string and Event object to methodPass a string and Event object to method
2.Pass a string and the Event object to the runMove() methodPass a string and the Event object to the runMove() method
3.Define object type as EventDefine object type as Event
4.Access SecurityErrorEvent object's text propertyAccess SecurityErrorEvent object's text property
5.Disables interactivity for events on the first and third PlotSeries objectsDisables interactivity for events on the first and third PlotSeries objects
6.Create event objectCreate event object
7.Event Object PropertiesEvent Object Properties
8.Event type and textEvent type and text
9.Event typeEvent type
10.Log event information to TextAreaLog event information to TextArea