Step by step prefab to Flash

Software: Prefab3D

Spiderguy, Newbie
Posted: 06 November 2012 06:17 PM   Total Posts: 2

Hi
I’m exhausted, I have spent 4 hours looking for a simple instruction on how to actually use the exportet class (away3d 4) in a project.
I got this far: I exported the model into the folder that also contains my .fla
it’s //projectfolder/mymodel/mymodel.as
now all I want to do is actually add the model to the view.
I tried:
import mymodel.mymodel; //error Definition could not be found
I tried setting the mymodel.as to be the Class -> Package cannot be used as a value.
So far I have not had too much trouble with away3D, though you can see from my attempts that I am not an experienced coder.
So please, without starting every sentence with “simply” so I feel extra stupid, could someone write something like this:
1) export model to your Project Path
2) import model by doing…
3) add model to view by doing…
I know it can’t be that hard, but I am stuck and every troubleshooting guide starts at a point I haven’t gotten to yet.
So thank you very much, whoever does or did this.

   

edsager, Newbie
Posted: 20 December 2012 11:08 AM   Total Posts: 3   [ # 1 ]

Did you ever find a tutorial or other solution?

Thanks,
edsager

   

hfeist, Jr. Member
Posted: 16 January 2013 12:59 AM   Total Posts: 37   [ # 2 ]

I’ve managed getting class export to work inside Flash Builder by exporting to an empty directory then dragging everything in that folder to the src dir in the Flash Builder project.

You can load the class into your view with something like:

var model=new Yourclass();
scene.addChild(model); 

If you want to deal with materials, collisions, etc. you can loop through the meshes

var numMeshes:uint model;

for(var 
i:uint 0i<numMeshesi++){    
  
var mesh:Mesh model.meshes[i];
  var 
name:String mesh.name;

  if ((
name.indexOf("floor")>-1)||(name.indexOf("ceiling")>-1))
    
{
      
// do your thing
      // i use name.indexOf because names applied to meshes often get
      // extra characters attached somewhere along the line
    

hope this helps

 

   

hfeist, Jr. Member
Posted: 16 January 2013 01:02 AM   Total Posts: 37   [ # 3 ]

make that

var numMeshes:uint model.meshes.length
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X