tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/739-away3d-and-robotlegs-how-to-have-a-mouseevent3d-firedRobotlegs: Discussion 2013-03-02T17:37:06Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/250057162013-02-16T17:13:05Z2013-03-02T17:37:05ZAway3D and Robotlegs : How to have a MouseEvent3D Fired??<div><p>Hi all</p>
<p>I am trying to use Robotlegs with Away3D. I am using the
<a href="http://www.paultondeur.com/2011/03/07/robotlegs-away3d-4-broomstick-integration-with-a-wink-at-unity/">
Robotlegs Away3D 4 integration by Paul Tondeur</a>.</p>
<p>I am trying to have a MouseEvent3D.MOUSE_OVER fired when the
mouse is over a 3D Object. I though that registering the event with
the following line of code</p>
<p>eventMap.mapListener(object3D, MouseEvent3D.MOUSE_OVER,
onMeshMouseOver);</p>
<p>in a class extending the Mediator3D would suffice by apparently
it doesn't work</p>
<p>As I am a Robotleg newbie, I must miss something. Would someone
have a clue of what I am doing wrong?</p></div>poq2011tag:robotlegs.tenderapp.com,2009-10-18:Comment/250057162013-02-17T11:05:05Z2013-02-17T11:05:05ZAway3D and Robotlegs : How to have a MouseEvent3D Fired??<div><p>Hi aeki,</p>
<p>If a mediator has a view injected like this:<br>
[Inject] public var someView : SomeView;</p>
<p>and you want to listen to an event dispatched by one of its
subcomponents (someSubcomponent), you can do this:<br>
eventMap.mapListener(view.someSubcomponent,
MouseEvent3D.MOUSE_OVER, onMeshMouseOver);</p>
<p>But, there is a better way to handle such situations. Inside
your View, you add a handler for an event like
MouseEvent3D.MOUSE_OVER. Within that handler you dispatch a custom
event. The mediator adds a listener for that custom event:<br>
addViewListener(SomeEvent.SOMETHING_HAPPEND, onSomethingHappened,
SomeEvent);</p>
<p>I explained why it is better to use custom events in this
post:</p>
<p><a href=
"http://knowledge.robotlegs.org/discussions/problems/644-events-being-caught-intermittently#comment_18891496">
http://knowledge.robotlegs.org/discussions/problems/644-events-bein...</a></p>
<p>For robotlegs 2 + awayy3D there is another extension:<br>
<a href=
"https://github.com/Vj3k0/robotlegs-bender-example-SARS-integration">
https://github.com/Vj3k0/robotlegs-bender-example-SARS-integration</a></p>
<p>Does this help?</p>
<p>Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/250057162013-02-18T18:03:09Z2013-03-02T17:37:06ZAway3D and Robotlegs : How to have a MouseEvent3D Fired??<div><p>Thanks for quick reply. The second way to do it sounds logical,
it should help!</p></div>poq2011tag:robotlegs.tenderapp.com,2009-10-18:Comment/250057162013-02-19T11:26:55Z2013-02-19T11:26:55ZAway3D and Robotlegs : How to have a MouseEvent3D Fired??<div><p>You're welcome!</p></div>Ondina D.F.