load 3ds file with events and textures?

1 view
Skip to first unread message

juliancruz87

unread,
Nov 24, 2009, 6:09:51 AM11/24/09
to away3d.dev
Hello, can I load 3ds file with mouse eventes and textures?
I use next code, but it doesn't work the mouse events.
thanks.



var logo:Loader3D;
var obj3D:Object3D = new Object3D();

logo = Max3DS.load("assets/vwc.3ds",
{texturePath:"assets/",name:"logo3D",loadersize:100});
obj3D = logo.handle;
trace(logo.handle);
obj3D.useHandCursor = true;
View.scene.addChild(logo);
obj3D.addOnMouseDown(mov);

function mov(event:MouseEvent3D):void{
trace("work it");
event.object.x +=10;
}

Peter Kapelyan

unread,
Nov 24, 2009, 9:43:32 AM11/24/09
to away3...@googlegroups.com
Hi Julian,

Can you send me or put your 3DS some where? Or some 3DS you use I can test with? I will try your code for you.

-Pete
--
___________________

Actionscript 3.0 Flash 3D Graphics Engine

HTTP://AWAY3D.COM

Peter Kapelyan

unread,
Nov 24, 2009, 6:04:19 PM11/24/09
to away3...@googlegroups.com
Hi Julian,
Here's your problems and how to fix:
 
Add this at top:

import away3d.events.Loader3DEvent;
And after : View.scene.addChild(logo);
Put this:
logo.addOnSuccess(onLoaderSuccess);

function onLoaderSuccess( event:Loader3DEvent ):void
{
 event.loader.handle.addOnMouseDown(mov);
}

That's it! Work it!! :)
-Pete
Reply all
Reply to author
Forward
0 new messages