robotlegs / robotlegs-framework

An ActionScript 3 application framework for Flash and Flex
https://robotlegs.tenderapp.com/
MIT License
967 stars 261 forks source link

EventMap: hooking into routing #140

Closed creynders closed 11 years ago

creynders commented 11 years ago

I wanted to do a quick 1-to-1 port of @Stray 's relaxed event map, but got stuck since it extends the normal event map and needs to override the routeEventToListener method. I know you'd rather not open up the method, but then I'd need some kind of hooking/override mechanism to override it, otherwise I'll be recreating 90% of the normal event map.

Easiest solution would seem to be to have an optional routingProcessor parameter in the event map constructor, I think.

darscan commented 11 years ago

Just a quick note: In RL1 the routeEventToListener was used for both typed and untyped mappings. In RL2 (at the moment) it's only used for typed mappings. Untyped mappings wire the listeners directly.

darscan commented 11 years ago

Although.. events weren't pushed onto the stack for untyped mappings, so...

darscan commented 11 years ago

I know you'd rather not open up the method, but then I'd need some kind of hooking/override mechanism to override it

Easiest solution would seem to be to have an optional routingProcessor parameter in the event map constructor

From a performance perspective we should probably just open up routeEventToListener.

darscan commented 11 years ago

OK, I've opened it up:

https://github.com/robotlegs/robotlegs-framework/commit/0a9e40b4204a32a563f206e7d5f3b4cb8ff7bcf6

creynders commented 11 years ago

Thanks a bundle, relaxedeventmap has been ported.