Shared context: not getting some mouse events

Software: Away3D 4.x

flexwiz, Newbie
Posted: 27 February 2014 11:34 PM   Total Posts: 14

In a project that has both Away3D and starling, I have this weird problem:

I would like to get mouse selection events for certain meshes. I followed the samples and added listeners to the mesh and set the mouseEnabled to true.

I only get the events for mouse_over and mouse_out, but can’t get the click, mouse_up or mouse_down.
I checked the stage, and was able to get flash click events from it.

My code:

var cube:Mesh = new Mesh( new CubeGeometry(500200500),  new  ColorMaterial0xCCCCee ) );
      
 
cube.mouseEnabled true;
 
cube.mouseChildren true;
 
worldView.scene.addChild(cube);

 
cube.addEventListener(MouseEvent3D.MOUSE_UPonClick); // Not working!!
 
cube.addEventListener(MouseEvent3D.MOUSE_OVERonMouseOver); // Works fine 

Any ideas on that?

   

John Brookes, Moderator
Posted: 28 February 2014 11:27 AM   Total Posts: 732   [ # 1 ]

My new rule for answering question.. cut paste smile

First whatever your issue is.
Test that issue in the most basic example you can do.
Most of the time you will find your own mistake just by doing that.

If your still getting the issue, then post the question.
WITH A FULL SIMPLE SOURCE AND ASSETS EXAMPLE.
ONE THAT CAN BE QUICKLY LOADED AND TESTED.
Use gist if its a simple no assets source or zip the stuff.

A snippet of code is useless in most of the questions Ive answered.
You may think that’s where the issue is but it may be somewhere else.

Doing that will enable others to see the issue or spot your mistake and provides new users examples or what to watch out for.
It will also serve as an example if a bug exists.

As for what you have posted I see no issues and last time I tested starling/Away mouse it worked. That may have changed so do the above please.

   

flexwiz, Newbie
Posted: 28 February 2014 07:20 PM   Total Posts: 14   [ # 2 ]

Thanks, John.

I followed your advice and found that the stage was set with mouseEnabled=false. Setting mouseEnabled to true on the stage fixed my problem.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X