tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/2316-macrobot-sequencecommand-issueRobotlegs: Discussion 2013-05-20T13:54:44Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/268594892013-05-16T07:58:42Z2013-05-16T07:58:42ZMacrobot SequenceCommand issue<div><p>I didn't have the time to drop this into a project and test it
out, but at a first glance I don't see anything wrong with it. Did
you test this bare bones setup, whether the problem really
persists?</p></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/268594892013-05-16T20:14:28Z2013-05-16T20:14:28ZMacrobot SequenceCommand issue<div><p>Yes. Here's a screengrab. About as bare bones as I can get. One
command that tries to sequence two others. Trace output at the
bottom shows that it only runs the first command.</p>
<p><img alt="Image Name" src=
"https://dl.dropboxusercontent.com/u/13810/commandtest.png"></p></div>cheezywhiztag:robotlegs.tenderapp.com,2009-10-18:Comment/268594892013-05-17T09:52:29Z2013-05-17T09:52:29ZMacrobot SequenceCommand issue<div><p>Ah, now I see it, you need to call the super
commandCompleteHandler</p>
<pre>
<code> override protected function commandCompleteHandler(success:Boolean):void
{
trace('commandCompleteHandler');
super.commandCompleteHandler(success);
}</code>
</pre>
<p>BTW the commandCompleteHandler is called for each executed
command, not just at the end of the sequence, so it should be
called twice in this case.</p></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/268594892013-05-17T13:53:11Z2013-05-17T13:53:11ZMacrobot SequenceCommand issue<div><p>Ah! I mistook 'commandCompleteHandler' to mean the entire
SequenceCommand was complete.. but it just means that each
sub-command is complete. This revised code does the trick. Thanks a
bunch!</p>
<pre>
<code>package
{
import flash.events.Event;
import org.robotlegs.utilities.macrobot.ParallelCommand;
import org.robotlegs.utilities.macrobot.SequenceCommand;
public class TestSequenceCommand extends SequenceCommand
{
public function TestSequenceCommand()
{
super();
addCommand(TestCommandA);
addCommand(TestCommandB);
addCompletionListener(sequenceComplete);
}
public override function execute():void
{
trace("TestSequenceCommand");
super.execute();
}
override protected function commandCompleteHandler(success:Boolean):void
{
trace("commandCompleteHandler");
super.commandCompleteHandler(success);
}
private function sequenceComplete(success:Boolean):void
{
trace("sequenceComplete");
dispatch(new Event(Event.COMPLETE));
}
}
}</code>
</pre></div>cheezywhiztag:robotlegs.tenderapp.com,2009-10-18:Comment/268594892013-05-17T14:46:57Z2013-05-17T14:46:57ZMacrobot SequenceCommand issue<div><p>Glad to be of help, if there's anything else, let us know!</p></div>creynders