What is in the examples, is also added to the doc...
http://away3d.com/livedocs/
select package loaders, then obj, and look at the examples...
you would see this one:
import away3d.loaders.Obj;
import away3d.events.LoaderEvent;
import away3d.loaders.Object3DLoader;
[...code...]
private var object3d:Object3D;
loadMyObjFile("mymodels/house.obj");
[..code...]
private function onLoaderSuccess(e:LoaderEvent):void
{
//the handle is now an Object3D, can be Mesh or ObjectContainer3D
object3d = e.loader.handle;
// properties Object3D
object3d.x = object3d.y = object3d.z = 0;
//accessing a child in a container
object3D = (e.loader.handle as ObjectContainer3D).children[0];
//example exporter to AS3
new AS3Exporter(object3d);
}
private function loadMyObjFile(url:String):void
{
var loader:Object3DLoader= Obj.load(url, {material:null, scaling:10,
bothsides:false});
loader.addOnSuccess(onLoaderSuccess);
// you can already addchild the file, but if you want to declare after
its loaded you can do it in the onLoaderSuccess handler
view.scene.addChild(loader);
}
as you can see, the handle is Object3D, here an example where the type
is ObjectContainer3D.
To assign a material to one child you would do:
(e.loader.handle as ObjectContainer3D).children[0].material =
myMaterial;
Fabrice
On May 12, 2009, at 12:21 PM, kakarlus wrote:
i did search x____X i used 'material' as search string >.>