I've been working on porting the Adobe AIR employee directory sample app to PureMVC as a learning exercise and I've come across a question that I'd like some input on.
The existing app has the following code in a LoadStyleSheetCommand:
var declEvent:IEventDispatcher = StyleManager.loadStyleDeclarations( fileName );
declEvent.addEventListener( StyleEvent.COMPLETE, onStyleLoad );
declEvent.addEventListener( StyleEvent.ERROR, onStyleLoadError );
If my understanding is correct, we shouldn't be using Flex events in a Command so here is my question:
do I treat the Flex StyleManager as a UI component and therefore create a StyleManagerMediator?
or is there a better way to handle this?
I'm inclined to come down on the side of the Mediator approach as this keeps all Flex event handling in the view.
Any suggestions?
Thanks,
Pete