tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/402-signalcommandmap-with-parameters-issuesRobotlegs: Discussion 2018-10-18T16:35:33Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/106926732011-10-18T10:04:05Z2011-10-18T10:07:29ZSignalCommandMap with parameters issues<div><p>Hi guys,</p>
<p>Firstly can I say that I am a newbie to robotlegs but have been
using Signals/AS3 for some time. I have googled and googled but
could not find a solid answer to my question and I hope you nice
people can help me.</p>
<p>I'm having trouble hooking up signals (with parameters) to
commands. I am getting the following errors:</p>
<p>"Exception fault: ArgumentError: Listener has 0 arguments but it
needs at least 1 to match the given value classes."</p>
<p>Below is a snippet of the offending code (apologies for
formatting):</p>
<p>MainContext.as:</p>
<pre>
<code> signalCommandMap.mapSignalClass(ChangeStateSignal, ChangeStateCommand);</code>
</pre>
<p>ChangeStateSignal.as</p>
<pre>
<code> public class ChangeStateSignal extends Signal {
public function ChangeStateSignal():void {
super(StateID);
}
}</code>
</pre>
<p>ChangeStateCommand.as</p>
<pre>
<code> public class ChangeStateCommand extends Command {
[Inject]
public var state : StateID;
[Inject]
public var coreModel : CoreModel;
override public function execute() : void {
coreModel.changeState(state);
}
}</code>
</pre></div>tomtag:robotlegs.tenderapp.com,2009-10-18:Comment/106926732011-10-18T10:19:05Z2011-10-18T10:19:06ZSignalCommandMap with parameters issues<div><p>It seems these issues are resolved when I update from Signals
0.8 to 0.9 Beta.</p>
<p>Close discussion :)</p></div>tom