Loaded awd file and mouseevents ?

Software: Away3D 4.x

komakalle, Newbie
Posted: 02 February 2012 01:02 PM   Total Posts: 1

Hello,

how can i add an eventlistener to a loaded awe object in away3d 4 ?

private function onResourceComplete(ev:LoaderEvent):void
    {
        _loader
.removeEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
        
_loader.removeEventListener(LoaderEvent.LOAD_ERRORonLoadError);

        
_myObjectContainer = new ObjectContainer3D();
        
_myObjectContainer _loader as ObjectContainer3D;

        
_loader.addEventListener(MouseEvent3D.CLICK,onMouseClick// Not working
        
_myCube = new Sphere(new ColorMaterial(0xff0000),100,100,100);
        
_myCube.mouseEnabled true;
        
_myCube.addEventListener(MouseEvent3D.CLICK,onMouseClick);
        
_view.scene.addChild(_myObjectContainer);
    


For my Sphere Mouseclick is working but not for my imported object.
How to do it ?  I cant mouseenable a ObjectContainer3D ?

Cheers

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X