05
Mar
09

ErrorEvent – equivalent to throw new Error?

A technical question for you out there:

I had a class that dispatched an ErrorEvent which was not listened for by any other class. That resulted in the player popping up an error dialogue very similar to the one you get from throwing Errors – and not catching them.

Nice image – imagine a juggler throwing three or four Errors into the air and catching some of them.

The documentation for ErrorEvents says that ErrorEvents without listeners will be displayed by the debugger, but I can’t quite see how it’s handled. ErrorEvent inherits TextEvent, nothing special there. I just wonder how the flashPlayer detects these events. Is there hard coded special handling of Errors? Or are there attributes of the ErrorEvent that tells the player to treat it differently from other events?

File under “unecessary fidling with the API”

Advertisements

1 Response to “ErrorEvent – equivalent to throw new Error?”


  1. 1 Derf
    October 1, 2009 at 1:27 am

    In as3 we don’t have access to EventManager (or whatever its name is), but its has more or less a structure like [eventType][dispatchers][listeners], so when an event is dispatched, this manager can test is the event is an ErrorEvent.
    And if there’s no listener registered to this dispatcher/eventType pair, an uncatchable error is thrown.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: