how to add eventListener to mesh when it had been added to stage?

Software: Away3D 3.x

Vadim, Newbie
Posted: 07 September 2012 11:57 AM   Total Posts: 3

Hello,
how to add eventListener to a mesh or to a material when it had been added to stage?

for example:

private function initObjects():void
{
   max3ds 
= new Max3DS();
   
max3ds.centerMeshes true;
   
max3ds.material materialArray[materialIndex];
   
   
loader = new LoaderCube();
   
loader.loaderSize 200;
   
loader.addOnSuccess(onSuccess);
   
loader.loadGeometry("assets/f360.3ds"max3ds);
   
   
scene.addChild(loader);
   
loader.addEventListener(Event.ADDED_TO_STAGEonAdded);
}
  
  
private function onAdded(e:Event):void
  {
   trace
("added");
  

“onAdded” doesn’t work in this way

   

kochumvk, Newbie
Posted: 07 September 2012 12:51 PM   Total Posts: 17   [ # 1 ]

If you are trying to add mouse events:

import away3d.events.MouseEvent3D;

yourMesh.addEventListener(MouseEvent3D.MOUSE_OVERyourEventHandler); 
   

Vadim, Newbie
Posted: 07 September 2012 12:54 PM   Total Posts: 3   [ # 2 ]

no, not mouse..
I want to draw scene into BitmapData after mesh added to stage..

   

Avatar
Darcey, Moderator
Posted: 07 September 2012 02:28 PM   Total Posts: 209   [ # 3 ]

On my loaders I use, this listener.

loader.addEventListener(AssetEvent.ASSET_COMPLETEonModelParseComplete); 
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X