Dan, the concept for try and catch is quite different to error handling. In try/catch you provide a reference to an object that represents the kind of error you can expect to handle.
Event handlers are not trying to catch a kind of event, they are catching a specific event. It's the differenc in flex between having a component in flex (of some class), but refer to it by its id to get at the instance. Paul ----- Original Message ----- From: "Dan" <danijel.arsenov...@gmail.com> To: <flexcoders@yahoogroups.com> Sent: Tuesday, January 13, 2009 2:39 PM Subject: [flexcoders] Re: How to create universal event handler? >> I can't help but think that you're getting mixed up between the difference >> in concept between the class of an event and the event name. > > Event handlers respond to specific event instances by name and not class. Paul, I think you are right. Since Event is represented by object, I thought you could create event handlers in polymorphic manner, just like when handling errors, when you write catch(e:MyErrorClass). Such catch would also handle MyChildErrorClass error. It seems that this does not work with events.. I guess the alternative is using custom dispatcher. Thanks! ------------------------------------ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links