Is there Mouse interaction BUG?

Software: Away3D 4.x

scutterry, Newbie
Posted: 17 September 2011 02:33 PM   Total Posts: 17
view = new View3D;
var 
bfm:BitmapFileMaterial = new BitmapFileMaterial("./assets/114.jpg");
cube = new  Cube;
cube.material bfm;
myLight = new PointLight();
myLight.color 0xffffff;
myLight.1000;
myLight.= -1000;
cube.material.lights [myLight];

cube.100;
cube.= -100;
view.camera.= -500;
cube.mouseEnabled true;
cube.addEventListener(MouseEvent3D.CLICKonClick);
view.scene.addChild(cube);
view.scene.addChild(myLight); 

the click area of the Cube in WRONG place!
as the Attachment

 

   

Avatar
Alejandro Santander, Administrator
Posted: 17 September 2011 05:08 PM   Total Posts: 414   [ # 1 ]

Hey Scutterry,

I’ve just tried picking with different materials and it seems to work perfectly. Are you sure you are using the latest github source and flash 11 player?

   

scutterry, Newbie
Posted: 18 September 2011 12:06 AM   Total Posts: 17   [ # 2 ]

I found the bug. When I changed the browser size, it worked incorrectly. But I added the following Metadata,

[SWF(width="800"height="600")

to assign the swf width and height. It worked.

   

Avatar
Alejandro Santander, Administrator
Posted: 18 September 2011 01:38 AM   Total Posts: 414   [ # 3 ]

You didn’t mention the browser size change before… What exactly are you referring to as the “bug”?

   

scutterry, Newbie
Posted: 18 September 2011 02:59 PM   Total Posts: 17   [ # 4 ]

@Alejandro Santander

Because I didn’t know that browser size changed would affect the location of the hit area.
By the way, i did NOT assign the swf size, and then changed the browser size. how to correct the location of the hit area.
Thanks.

   

Avatar
80prozent, Sr. Member
Posted: 18 September 2011 03:44 PM   Total Posts: 430   [ # 5 ]

hi

i guess you need a eventListener to listen for a stage-resize event. whenever the stage is resized, you need to adjust the hitArea of your object.
i dont know how this is done (didnt tried any mouse interactions myself so far….), but i guess removing the mousevent3D-listener and applying it to the object again could work.

hope this is no nonsense.

 Signature 

sorry…i hope my actionscript is better than my english…

   

Avatar
Alejandro Santander, Administrator
Posted: 20 September 2011 02:12 AM   Total Posts: 414   [ # 6 ]

Its not like that 80.

If you don’t listen to stage resizes and resize the browser, the 3D render area will remain the same size, with no dis-alignment between your interactive renderable and its hit area.

If you do listen for stage resizes, and on such events do

view.width stage.stageWidth;
   
view.height stage.stageHeight

 
the 3D render area will resize as well, with no dis-alignment between your interactive renderable and its hit area.

@scutterry: You should not be having those offsets. I ask again, are you using the latest github source? If you’ve cleared that out already and are still experiencing the bug, please send us some code to look at other than that you have shown, which seems to be correct. Try to simplify your problem in a test that reduces it to the simplest situation possible that still exposes the bug.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X