Posts Tagged ‘Application.application’

Alternative to Application.application

August 27, 2010

If you are using Application.application in your code you aren’t probably doing the best thing to your code for reasons more than one. Like Flex 4 no longer supports it, While using sub-applications or modules it will end up in trouble and MOST IMPORTANTLY it will tightly couple your application to the component

Instead, for most cases you (if you are dispatching an even using Application.application) you can set the events bubble property to true and listen to the same events at the application level. This will work for itemRenderers in DataGrid’s too.

Other option is to use a GenericEventDispatcher that extends from EventDispatcher and can be a singleton. So instead of dispatching an event using Application.application.dispatchEvent you can instead use GenericEventDispatcher.instance.dispatchEvent. This will work across all components and also between modules and sub-applications.

Advertisements

%d bloggers like this: