An example that lets the user choose a style to load and uses a Mate extension (StyleLoader) to load it from the event map.
This example shows:
- How to extend Mate by adding a tag that handles results and fault returned by Flex's Style Manager when loading a new compiler css style.
- How to use the ResponseHandler tag in the view to receive responses sent by the event map.
Yes, this example uses Degrafa to show the background patterns.
<mate:Dispatcher id="dispatcher" type="{StyleLoaderEvent.STYLE_CHANGE}" generator="{StyleLoaderEvent}">
<mate:ResponseHandler response="currentState = 'complete'" type="{StyleLoaderEvent.LOAD_COMPLETE}" />
<mate:ResponseHandler response="currentState = 'error'" type="{StyleLoaderEvent.FAULT}" />
</mate:Dispatcher>
Using injectors you can get around this so that you can keep the Mate framework separate from your views right?
Yes, you can use the new tag Callback to achieve the same result.