views:

43

answers:

1

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 mechanism for tracing every event dispatched from a component. Is this possible?

+1  A: 

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 :-)

Lior Cohen
since the goal is to see what event is being dispatched, it might be worth changing `trace('some text here')` to `trace(event.type)`
greg
I ended up doing exactly this (which struck me moments after asking the question).I'd still like to see a solution that doesn't require code changes.
Chris R
Modified the answer the reflect greg's comment. Thanks.
Lior Cohen