Modules

Mate works with Flex Modules. Depending on your needs, you can have an EventMap within the main application and other event maps included within the modules themselves.

Regardless of where the event maps are placed, however, events dispatched anywhere (in any module) will trigger EventHandlers listening for those event types in all event maps (those included in the main application plus those event maps included in modules that have been loaded).

It is recommended that any event that represents some action that can be shared among modules be handled in an EventMap placed in the main application. In that way, your modules can dispatch events knowing that they will be handled by a shared event map. Any event that is specific to a module, should be placed in an event map that is placed in the module's main file. When the module dispatches this specific event, its own event map will handle it.

Under this configuration, you would have:

  • Main application
  • MainEventMap.mxml
  • Module A
  • ModuleAEventMap.mxml

Lastly, there could be events handled by both the main map and the module's map. If you wish to specify the order by which each event map will handle the event, you can use the priority attribute of the EventHandlers tag.

0 responses so far

Leave a response

If you need help or want to comment on something not related to this page, please post in the forums. Thanks!

Leave this field empty