i'm having problems with the owncanvas property. When i try to add a
mouse3devent3d listener it doesn't work if the property owncanvas is
true.
this is my function:
private function windowMouseDown(e:MouseEvent3D):void
{
trace("click on window");
}
this code works:
var window:Plane = new Plane({material:windowMaterial, height:100,
width:100, segmentsH:4, segmentsW:4, ownCanvas:false});
window.bothsides=true;
window.screenZOffset=-1000;
view.scene.addChild(window);
window.addOnMouseDown(windowMouseDown);
// or window.addEventListener(MouseEvent3D.MOUSE_DOWN,
windowMouseDown);
this doesn't works:
var window:Plane = new Plane({material:windowMaterial, height:100,
width:100, segmentsH:4, segmentsW:4, ownCanvas:true}); //now i set
ownCanvas to true
window.bothsides=true;
window.screenZOffset=-1000;
view.scene.addChild(window);
window.addOnMouseDown(windowMouseDown);
// or window.addEventListener(MouseEvent3D.MOUSE_DOWN,
windowMouseDown);
I tried to add the object to and object container.
this code works:
windowContainer=new ObjectContainer3D();
view.scene.addChild(windowContainer);
var window:Plane = new Plane({material:windowMaterial, height:100,
width:100, segmentsH:4, segmentsW:4, ownCanvas:false});
window.bothsides=true;
window.screenZOffset=-1000;
windowContainer.addChild(window);
window.addOnMouseDown(windowMouseDown);
// or window.addEventListener(MouseEvent3D.MOUSE_DOWN,
windowMouseDown);
this doesn't works:
windowContainer=new ObjectContainer3D();
view.scene.addChild(windowContainer);
var window:Plane = new Plane({material:windowMaterial, height:100,
width:100, segmentsH:4, segmentsW:4, ownCanvas:true});//now i set
ownCanvas to true
window.bothsides=true;
window.screenZOffset=-1000;
windowContainer.addChild(window);
window.addOnMouseDown(windowMouseDown);
// or window.addEventListener(MouseEvent3D.MOUSE_DOWN,
windowMouseDown);
*in this case i can't add the event listener to the whole
objeccontainer3d because i have lots of planes (an array of planes). I
need to add the event listener to each plane.
What am i doing wrong? i need the onwcanvas property set to true, if i
can't add event listeners to the object while the property is false I
have a big problem.
Thank You.
Alex.