I have created a class (extends the Event class) for use in one of my projects. If I trace the custom event object in the called function I get 'Event' as the type, but if I trace a TimerEvent, or MouseEvent, etc, I get TimerEvent or MouseEvent... Let me demonstrate:
var c:CustomObject = new CustomObject();
c.addEventListener(CustomEvent.ON_SEND_MESSAGE,fnc);
function fnc(e:CustomEvent) {
    trace(e);
}
This traces:
[Event type="onSendMessage" bubbles=false cancelable=false e开发者_如何学编程ventPhase=2]
While this code:
var f:Timer = new Timer(2000);
f.addEventListener(TimerEvent.TIMER,th);
f.start();
function th(e:TimerEvent):void {
    trace(e);
}
traces this:
[TimerEvent type="timer" bubbles=false cancelable=false eventPhase=2]
Why does my custom event class not trace [CustomEvent ...]
You need to override the toString() method:
public override function toString(): String
{
   return "[CustomEvent]";
}
Disclaimer: Haven't used flash/flex in a while. But I think that is correct.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论