Hi everybody,
I have a cube in my scene. I would like to assign a click listener to it. This all works “fine” with one liiiittle problem - the cube is clickable only in its center area (let’s say an area of 100x100) If I click outside of this area, but still on the cube, nothing happens. The code I am using is this simple:
var texture:BitmapTexture = new BitmapTexture(new AntTexture().bitmapData);
var material:TextureMaterial = new TextureMaterial(texture);
cube = new Mesh(new CubeGeometry(400, 400, 400, 1, 1, 1, false), material);
cube.mouseEnabled = true;
cube.addEventListener(MouseEvent3D.CLICK, cubeClickHandler);
cube.z = 1500;
scene.addChild(cube);
....
private function cubeClickHandler(event:MouseEvent3D):void {
navigateToURL(new URLRequest("http://www.google.com"));
}
I have uploaded a picture that demonstrates the clickable area (yellow rectangle). All the rest of the cube does nothing. Why is that, what am I doing wrong? Thanks a lot!