You can execute commands in 2 ways: directly and indirectly.
- You can execute commands directly using
Second parameter is optional and will be passed to execute function as parameter.
commandMap is accessible from your
Module classes and other
- To execute commands indirectly you will need to use framework messages:
First you need to map
Cammand class to message string.
Then this is done, the only thing you need to do to get your Command executed – send a message. (Second parameter is optional and will be passed to execute function as parameter.)[as3] sendMessage("messageName", new ParamVO());
You can send messages from all framework actors :
It’s good idea to store message string – “messageName” in a constant.
It is better practice to use messages to execute your command in almost all cases.
But there is some exceptions, for example if you don’t plan to reuse your command, or your command is tightly bundled with current command(or module) in the way that it does not make sense to use outside of it.