tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/798-best-practice-for-stage-listeners-and-mediators-that-use-themRobotlegs: Discussion 2012-01-17T12:26:06Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/129546162012-01-17T09:19:57Z2012-01-17T09:19:57ZBest Practice for stage listeners and mediators that use them.<div><p>Hey Mr. Cheeks,</p>
<blockquote>
<p>Just learning robotlegs. This is most probably a really basic
question... sorry in advance, still grasping everything.</p>
</blockquote>
<p>No problem:)</p>
<p>[Inject] public var view:ContextView;</p>
<p>override public function onRegister():void<br>
{</p>
<p>eventMap.mapListener(view.stage, Event.MOUSE_LEAVE,
stage_mouseLeave);</p>
<p>}</p>
<p>private function stage_mouseLeave(event:Event):void<br>
{</p>
<p>trace("stage_mouseLeave(event)");</p>
<p>}</p>
<p>or, you can let the view dispatch a custom event in its handler
function of the MOUSE_LEAVE event and in onRegister the Mediator
would listen for that event:<br>
addViewListener (SomeViewEvent.SOME_ACTION, someActionHandler);</p>
<p>or, simply listen and re-dispatch it, if need be:<br>
addViewListener (SomeViewEvent.SOME_ACTION, dispatch);</p>
<p>Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/129546162012-01-17T11:28:03Z2012-01-17T11:28:04ZBest Practice for stage listeners and mediators that use them.<div><p>thankyou. :)</p></div>mrcheekstag:robotlegs.tenderapp.com,2009-10-18:Comment/129546162012-01-17T11:28:35Z2012-01-17T11:28:35ZBest Practice for stage listeners and mediators that use them.<div><p>how easy is that!</p></div>mrcheekstag:robotlegs.tenderapp.com,2009-10-18:Comment/129546162012-01-17T12:26:05Z2012-01-17T12:26:05ZBest Practice for stage listeners and mediators that use them.<div><p>You’re welcome!<br>
Enjoy robotlegs:)</p></div>Ondina D.F.