The workings of MouseEvent3D..

Software: Away3D 4.x

Mr Margaret Scratcher, Sr. Member
Posted: 09 July 2011 04:04 PM   Total Posts: 344

A quick question, again relating to migrating from papervision3d to Away3d broomstick..

So I’ve found that InteractiveScene3DEvent in pv3d is MouseEvent3D in away 3D, which I can get to work on a basic level, but I’m having trouble figuring out how to reference the target object.

in PV3d:

private function CasePress(e:InteractiveScene3DEvent):void
  
  {
  
  Pressed 
e.displayObject3D;
  
trace ("casePress p =" +Pressed)
  

so e.displayObject3D is the object that was clicked triggered the event.

In Away3d, I’ve found that a rough equivalent of displayObject3D is ObjectContainer3D, at least in as much as you can create one and add children to it, but it differs in that in PV3D it can be used as a generic term for any 3D object, but in Away3D doing

Pressed = e.ObjectContainer3D; does not seem to work..

Aha… e.Object seems to be the one…. smile

   

Richard Olsson, Administrator
Posted: 10 July 2011 11:55 AM   Total Posts: 1192   [ # 1 ]

As is always the case in Flash, the events have currentTarget and target properties that should indicate what object was clicked. You should be able to use those (and if you’re not then that’s a bug, so please let us know if that doesn’t work.)

   

Mr Margaret Scratcher, Sr. Member
Posted: 10 July 2011 02:53 PM   Total Posts: 344   [ # 2 ]

Yes i did try currentTarget whilst trying to get it to work, and then figured out that e.Object was the equivalent to e.DisplayObject3D midway through writing my post.

I thought I might as well post it up in case anyone else was trying to figure it out.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X