开发者

How can I trace every event dispatched by a component or its descendants?

I am trying to determine what events I need to wait for in a test in order to ensure that my custom component has updated all of its properties. I was using VALUE_COMMIT, but for some reason that isn't working out for me.

So, I want some easy m开发者_JAVA百科echanism for tracing every event dispatched from a component. Is this possible?


Your component (or one of its ancesors) is probably implementing the IEventDispatcher interface (right?).

You could override the dispatchEvent() method in your component like so:

override public function dispatchEvent(event:Event):Boolean
{
  trace(event.type);
  return super.dispatchEvent(event);
}

This depends on the class you're extending. More info please :-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜