Accessing object in AWD scene via Actionscript

Software: Away3D 4.x

Liger, Newbie
Posted: 02 May 2013 06:07 AM   Total Posts: 3

Hey all,

Hopefully someone can help me with something as simple as this. I’m trying to access a mesh from within a AWD file. To make it really simple I have 2 cubes in a scene I exported from max. It just has 2 objects inside it. 1 called ‘obj1’ and the other ‘obj2’.

I’ve got the file to export to a AWD fine and can load it into my scene just fine. But how do I access each object and say move one on mouse click?

Is there a tutorial for properly using the asset library to access the objects in a prefab scene too? Can’t find an up to date one anywhere

Cheers

   

Avatar
Fabrice Closier, Administrator
Posted: 02 May 2013 08:44 AM   Total Posts: 1265   [ # 1 ]

There are many ways to access meshes in Away3D. It is not awd format specific. Look at examples, and especially how to set an assetComplete listener if you need to access a given mesh during parsing, or AssetLibray.getAsset etc…

If you use Prefab, note that as3 exports eases greatly your code, a simple import of the class + addchild is enough. The class provides getters: meshes and containers.

   

Liger, Newbie
Posted: 02 May 2013 11:28 PM   Total Posts: 3   [ # 2 ]

Thanks for you help. Downloaded and checked out a few of the samples but have yet to come accross a sample where there is multiple meshes in an AWD or other file for that matter?

I’m loading my AWD file exported from prefab and there is definitely 2 meshes in there with names? But how can I access them? I’m using the asset library class as well.

   

Liger, Newbie
Posted: 03 May 2013 06:35 AM   Total Posts: 3   [ # 3 ]

Nevermind got it going.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X