mouse event not firing

Software: Away3D 4.x

Avatar
maddog, Sr. Member
Posted: 20 October 2011 12:17 AM   Total Posts: 118

I am trying to get a function to fire when you click on a plane in version 4x of away3d.  In the old version 3x I would:

plane1.addEventListener(MouseEvent3D.MOUSE_UPonClickModel);

function 
onClickModel(event:MouseEvent3D):void {
   tester
.text event.object.name;
  

This no longer works for me in version4x of away3d 4. Any ideas of what i am doing wrong. Thanks for any help

 

   

Avatar
maddog, Sr. Member
Posted: 20 October 2011 04:33 AM   Total Posts: 118   [ # 1 ]

objects must be set to mouse inactive i guess

so i plane1.mouseEnabled=true;

   

Flying Kiwi, Newbie
Posted: 27 October 2011 02:08 PM   Total Posts: 3   [ # 2 ]

Hi,

I have the same issue, tho setting mouseEnabled to true does not solve my issue.

I checked the Mouse3DManager class, which is being used by the view3d.
I added some traces in this Mouse3DManager class (in the onClick handler of the view3d, but that doesnt get fired either.
So im guessing the problem lies there instead of with the plane/object i’m binding events to…

Anyone else can confirm this bug (if its a bug) or otherwise point me out on how to use the MouseEvent3D?

Thanks in advance!

   

KeithT, Newbie
Posted: 27 October 2011 05:26 PM   Total Posts: 6   [ # 3 ]

I have the same issue:

mesh = new Cube(material, 200, 200, 200);
mesh.mouseEnabled;
mesh.mouseDetails = true;
mesh.addEventListener(MouseEvent3D.MOUSE_DOWN, _onComponentMouseDown, false, 0, true);

Handler never fires.

Although looking at the examples where the “ground” has a mouse handler, this works:

var ground : Plane = new Plane(material, 50000, 50000);
ground.mouseEnabled = true;
ground.mouseDetails = true;
ground.addEventListener(MouseEvent3D.MOUSE_DOWN, onMouseDown);
ground.addEventListener(MouseEvent3D.MOUSE_UP, onMouseUp);
ground.addEventListener(MouseEvent3D.MOUSE_MOVE, onMouseMove);
_view.scene.addChild(ground);

but don’t see why one works and the other does not ...

   

Avatar
maddog, Sr. Member
Posted: 27 October 2011 07:52 PM   Total Posts: 118   [ # 4 ]

——

   

Avatar
maddog, Sr. Member
Posted: 27 October 2011 08:00 PM   Total Posts: 118   [ # 5 ]
Flying Kiwi - 27 October 2011 02:08 PM

Hi,
So im guessing the problem lies there instead of with the plane/object i’m binding events to…

Anyone else can confirm this bug (if its a bug) or otherwise point me out on how to use the MouseEvent3D?

Thanks in advance!

If you show some of your code maybe someone can figure whats wrong with it.

   

Flying Kiwi, Newbie
Posted: 28 October 2011 06:43 AM   Total Posts: 3   [ # 6 ]

i have this in a class wich extends from plane

//listen to click
this.mouseEnabled true;
this.addEventListener(MouseEvent3D.CLICK   onClick_plane);
this.addEventListener(MouseEvent3D.MOUSE_OVER onClick_plane);
this.addEventListener(MouseEvent3D.MOUSE_OUT onClick_plane);
this.addEventListener(MouseEvent3D.MOUSE_MOVE onClick_plane);
this.addEventListener(MouseEvent3D.MOUSE_DOWN onClick_plane); 

the planes get added to a container

//add mesh to projectContainer
_projectContainer.addChild(plane); 

and, finally, i have a view to show it all to me.

//setup view
_view    = new View3D(sceneManager.scenesceneManager.camera);
_view.antiAlias   8;
_view.mouseEnabled true;
_view.mouseChildren true;
_view.backgroundColor 0xFFFFFF;
addChild(_view); 

as i mentioned in earlier, my code i pretty straight forward, unless i’m missing something really important.

   

Flying Kiwi, Newbie
Posted: 28 October 2011 09:14 AM   Total Posts: 3   [ # 7 ]

I figured it out, it was the Main.fla which mouseEnabled was false.

So mouseEnabled was ON on everything xcept the main.fla creating the stage.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X