Can’t import away3d to flex project

Software: Away3D 4.x

Andrusza, Newbie
Posted: 11 September 2011 05:51 PM   Total Posts: 5

Hello I have strange problem with importing things I am green in flash/java so probably I am doing something wrong and silly.
I use Flex 4.5.

when I type import I get list of lib to chose and away3d is one of them.
for example I try to use

import away3d.containers.View3D


but when i try to debug the project i always get
“1172: Definition away3d.containers:View3D could not be found.”

I don’t know what I am doing wrong .
i add unpacked folder
away3d_4_0_0_molehill by adding it to project like this Project->properties->ActionScript Build Path->Source Path->Add folder

any ideas?

 

 

 

   

Andrusza, Newbie
Posted: 12 September 2011 09:30 AM   Total Posts: 5   [ # 1 ]

ok thanks to
this guide
http://www.allforthecode.co.uk/aftc/forum/user/modules/forum/article.php?index=5&subindex=1&aid=284

finally i was able to set up away3d environment but when i debug simply project only background color is displayed
why 3d objects are not displaying?
i am using firefox and my sys is win7 x64

code i use

package
{
 import away3d
.containers.View3D;
 
import away3d.materials.ColorMaterial;
 
import away3d.primitives.Cube;
 
 
import flash.display.Sprite;
 
import flash.events.*;
 
 public class 
test extends Sprite
 {
  
private var view:View3D;
  private var 
cube:Cube;
  
  public function 
test()
  
{
   view 
= new View3D();
   
addChild(view);
   
   var 
material:ColorMaterial = new ColorMaterial(0xFF0000);
   
cube = new Cube(material);
   
   
view.scene.addChild(cube);
   
   
addEventListener(Event.ENTER_FRAMEonEnterFrame);
   
  
}
  
  
private function onEnterFrame(e:Event):void
  {
   cube
.rotationY += 10;
  
}
 }
   

Avatar
Alejandro Santander, Administrator
Posted: 13 September 2011 03:08 PM   Total Posts: 414   [ # 2 ]

Hey Andrusza,

You need to render the view on enterframe:

view.render();

I recommend viewing the examples on github away3d/away3d-examples-fp11
There you will quickly see the basic usage of Away3D 4.x.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X