colouredfunk, Newbie Posted: 14 June 2013 08:52 PM Total Posts: 9
Hello all,
I seem to be missing something; all I’m trying to do is add a MouseUp Event on a ObjectContainer3D or a Mesh, but I can’t seem to get it to work.
Can someone help me out please
var board:Mesh = new Mesh(new CubeGeometry(boardWidth, 10, 600), baseColour); board.mouseEnabled = true; board.addEventListener(MouseEvent3D.MOUSE_DOWN, onCharacterClick)
private function onCharacterClick(e:MouseEvent):void { trace("onCharacterClick"); //e.currentTarget.close() }
80prozent, Sr. Member Posted: 15 June 2013 12:11 AM Total Posts: 430
[ # 1 ]
Hi
I think this:
private function onCharacterClick(e:MouseEvent):void
should be this:
private function onCharacterClick(e:MouseEvent3D):void
Hope that Helps
colouredfunk, Newbie Posted: 15 June 2013 09:59 AM Total Posts: 9
[ # 2 ]
Thanks for your reply. I did have the event declared as MouseEvent3D, I just changed it for testing…
private function onCharacterClick(e:MouseEvent3D):void { trace("onCharacterClick"); //e.currentTarget.close() }
Still doesn’t work :(
80prozent, Sr. Member Posted: 15 June 2013 01:07 PM Total Posts: 430
[ # 3 ]
Hi
For me you code worked when changed to MouseEvent3d
80prozent, Sr. Member Posted: 15 June 2013 01:47 PM Total Posts: 430
[ # 4 ]
Hi
Just tested again, and its workin….
I just put your code into the Basic_View example from github (dev).
So if it is not working in your project, try looking into the Basic_View example….
colouredfunk, Newbie Posted: 17 June 2013 09:18 AM Total Posts: 9
[ # 5 ]
Arhhh!! I’m using a framework that I’ve written for other iOS projects, and I had completely forgotten that the stage is set to visible = false!
Setting the sprite containing View3D to visible, made all mouse interactions work as expected!! I had no idea is was set to false as I could see al the 3D objects.
Thanks for your time, sorry it was something so stupid!