tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/530-adobe-air-for-android-dev-with-robotlegsRobotlegs: Discussion 2013-04-28T10:21:20Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/71133172011-05-18T19:58:24Z2011-05-18T19:58:24Zadobe air for Android dev with robotlegs<div><p>Hey Mike and sorry for the delayed response!</p>
<p>I'd recommend re-dispatching the events on the shared event bus
or, if you're using that, mapping them on the SignalCommandMap.
Then, you can implement the logic for properly reacting to them in
commands.</p>
<p>This approach has the advantage of not only encapsulating your
current logic in the proper place(s), but it also allows you to
freely extend your application's reaction later on. E.g., if you
later decide that part of your view should change in reaction to
these events, you can listen to them in the right mediator(s) and
implement that behavior in your views.</p></div>Till Schneidereittag:robotlegs.tenderapp.com,2009-10-18:Comment/71133172011-05-19T10:20:24Z2011-05-19T10:20:25Zadobe air for Android dev with robotlegs<div><p>Hi tschneidereit<br>
Thanks for your reply i thought no one would answer. So do you mean
something like the below. If you can leave an example would
appricate it as I am still new to robotlegs:</p>
<p>public override function startup ( ):void {</p>
<p>commandMap.mapEvent(Event.Event.DEACTIVATE, DeactivateCommand,
Event);</p>
<p>commandMap.mapEvent(Event.Event.ACTIVATE, activateCommand,
Event);</p>
<pre>
<code>// And we're done
super.startup();</code>
</pre>
<p>}</p>
<p>regards mIke :)</p></div>Mike Oscartag:robotlegs.tenderapp.com,2009-10-18:Comment/71133172011-05-19T13:34:20Z2011-05-19T13:34:20Zadobe air for Android dev with robotlegs<div><p>Well, you need to get those events onto the central event bus
some way<br>
or another. The easiest way to do that is to simply forward them
from<br>
the contextView onto the event bus. After that, you can indeed
simply<br>
map commands to those events:</p>
<p>public override function startup ( ):void<br>
{</p>
<pre>
<code>contextView.addEventListener(Event.ACTIVATE, dispatchEvent);
contextView.addEventListener(Event.DEACTIVATE, dispatchEvent);
commandMap.mapEvent(Event.DEACTIVATE, DeactivateCommand, Event);
commandMap.mapEvent(Event.ACTIVATE, ActivateCommand, Event);
// And we're done
super.startup();</code>
</pre>
<p>}</p>
<p>cheers,<br>
till</p></div>Till Schneidereittag:robotlegs.tenderapp.com,2009-10-18:Comment/71133172011-05-19T15:00:52Z2011-05-19T15:00:52Zadobe air for Android dev with robotlegs<div><p>Hi till<br>
Thanks that has cleared everything up. Thanks for example as well
makes it easier to understand and see what you can do with
robotlegs.</p>
<p>regards Mike :)</p></div>Mike Oscartag:robotlegs.tenderapp.com,2009-10-18:Comment/71133172011-05-19T15:05:05Z2011-05-19T15:05:05Zadobe air for Android dev with robotlegs<div><p>Cool, glad I could help!</p></div>Till Schneidereit