MouseEvent3d not triggered

Software: Away3D 4.x

Mich, Newbie
Posted: 04 July 2011 09:38 AM   Total Posts: 4

Hi all!

There’s something a little bizarre, when I set a listener on meshes, only the MouseEvent.MOVE is triggered. And, I didn’t forget to activate the mouseEnabled property.
Someone has known the same situation ?

Thx.

if (event.asset.assetType == AssetType.MESH{
  
var me:Mesh event.asset as Mesh;
  
addToScene(me);
  
me.mouseEnabled true;
  
me.addEventListener(MouseEvent3D.MOUSE_DOWN click);
  
me.material.repeat true;
   

Mich, Newbie
Posted: 04 July 2011 10:28 AM   Total Posts: 4   [ # 1 ]

other test :

var cube:Cube = new Cube(new ColorMaterial(0xFF0000));
cube.addEventListener(MouseEvent3D.CLICK, function():void { trace("CLICK");
cube.addEventListener(MouseEvent3D.DOUBLE_CLICK, function():void { trace("DOUBLE_CLICK");
cube.addEventListener(MouseEvent3D.MOUSE_DOWN, function():void { trace("MOUSE_DOWN");
cube.addEventListener(MouseEvent3D.MOUSE_MOVE, function():void { trace("MOUSE_MOVE");
cube.addEventListener(MouseEvent3D.MOUSE_OUT, function():void { trace("MOUSE_OUT");
cube.addEventListener(MouseEvent3D.MOUSE_OVER, function():void { trace("MOUSE_OVER");
cube.addEventListener(MouseEvent3D.MOUSE_UP, function():void { trace("MOUSE_UP");
cube.addEventListener(MouseEvent3D.MOUSE_WHEEL, function():void { trace("MOUSE_WHEEL");
cube.addEventListener(MouseEvent3D.ROLL_OUT, function():void { trace("ROLL_OUT");
cube.addEventListener(MouseEvent3D.ROLL_OVER, function():void { trace("ROLL_OVER");
   
cube.mouseEnabled true;
addToScene(cube); 

CLICK : no
DOWN :  no
MOVE :  yes
OUT :  yes
OVER :  yes
UP : no
WHEEL : no
ROLL_OUT : no
ROLL_OVER : no

   

John Brookes, Moderator
Posted: 04 July 2011 11:40 AM   Total Posts: 732   [ # 2 ]

All work for me with the above code.
Only difference in my test is scene.addChild(cube);

   

Mich, Newbie
Posted: 04 July 2011 12:05 PM   Total Posts: 4   [ # 3 ]

Ok, the problem might be elsewhere.

Thx to have seen.

   

Mich, Newbie
Posted: 04 July 2011 12:39 PM   Total Posts: 4   [ # 4 ]

Yeah, I did it.
I set the parent of View3D : UIComponent > Sprite.

   

LIO, Newbie
Posted: 14 February 2012 02:46 PM   Total Posts: 4   [ # 5 ]

public function CameraControlerGame(v:View3D , s:Stage,d:Elevation)
  {
  _view = v
  _camera = _view.camera
  _camera.lens =_lens
  _camera.lens.near = 0.1
 
  _terrianElevation = d;
   
 

 
  _cameraControler = new HoverController(_camera , _cameraTarget,0,30,30,20,89)

  _cameraControler.steps = 2;
  _stage = s
 
 
  _terrianElevation.addEventListener(MouseEvent3D.MOUSE_OVER, onMouse3dClick)
 
  _stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseButtonDown )
  _stage.addEventListener(MouseEvent.MOUSE_UP, onMouseButtonUp )
 
  _stage.addEventListener(MouseEvent.MOUSE_WHEEL , onMouseScroll)
 
 
  _stage.addEventListener(KeyboardEvent.KEY_DOWN , onKDown)
  _stage.addEventListener(KeyboardEvent.KEY_UP , onKUp)
 
 
 
  }
  public function onMouse3dClick(e:MouseEvent3D):void
  {
  trace(e.target.x)
  }


Hi MouseEvent3D doesn’t work here. What is wrong with it. I tried everything but it doesn’t trigger the event at all. I’m trying to get the coordinates of an Elevation when mouse click.Thanks in advance smile . Chears

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X