(This tag must be placed inside an <EventHandlers> tag or a <MessageHandlers> tag)
The CommandInvoker tag is very similar to the MethodInvoker tag, but limited. It only allows specifying the generator class to instantiate. It will always call the method "execute" and pass the current event as its only argument. This tag is very useful when reusing Cairngorm commands.
<CommandInvoker generator="CommandClassName" />
The above example would be the same as doing the following in ActionScript code:
var myCommand:CommandClassName = new CommandClassName(); myCommand.execute(event);
CommandInvoker is
only a short-cut tag, as the same can be accomplished with a MethodInvoker tag:
<MethodInvoker
generator="CommandClassNameToInstantiate"
method="execute"
arguments="{event}"/>
Note: when placed inside a MessageHandlers list, the command will receive a MessagingEvent.
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!