Problem getting started

Software: Away3D 4.x

rhernando, Newbie
Posted: 21 November 2012 02:41 PM   Total Posts: 2

Hi,

I’m trying to start with away3d, my objective is to add simple 3D objects and animations to my projects, like spheres, boxes, planes, skyboxes, text and some simple models, but I’m having a lot of trouble getting started, I tried to create something with flash CS4 IDE but I got no results, so I got flash builder but now I can’t even get a simple plane going. Here’s my code so far:

package
{
 import away3d
.containers.View3D;
 
import away3d.entities.Mesh;
 
import away3d.materials.ColorMaterial;
 
import away3d.primitives.PlaneGeometry;
 
 
import flash.display.Sprite;
 
import flash.events.Event;
 
import flash.geom.Vector3D;

 
[SWF(width 640height=480frameRate=60)]
 
public class Main extends Sprite
 {
  
private var view:View3D;
  private var 
plane:Mesh;
  private var 
Event:Object;
  public function 
Main()
  
{
   setupScene
();
  
}
  
  
private function setupScene():void
  {
   view 
= new View3D();
   
addChild(view);
   
   
plane = new Mesh(new PlaneGeometry(),new ColorMaterial(0xFF0000));
   
   
view.scene.addChild(plane);
   
   
view.camera.= -500;
   
view.camera.300;
   
view.camera.lookAt(new Vector3D());
   
   
addEventListener(Event.ENTER_FRAMEloop);
  
}
  
  
protected function loop(event:Event):void
  {
   view
.render();
  
}
 }

And I’m getting the following error

1046: Type was not found or was not a compile-time constant: Event. Main.as /cubo 3d/src line 39 Flex Problem

Anyway I would thank any help regarding this issue and also any answer to the following question:
Considering what my intentions are(like I said, adding simple 3D stuff to web apps, projectors, etc.) is Away3D the stuff for me or I’m over my head here and should aim to something more simple?, i tried with swift 3d but the rendering quality/file size relation is not very good and also there’s no possible way to interact with the created elements so I looked around and read that everyone recommended Away3D.

Thank You,
Rodrigo.

   

synkarius, Member
Posted: 21 November 2012 06:25 PM   Total Posts: 64   [ # 1 ]

Comment out this line:

private var Event:Object

You’re using a class name as a variable name. Plus, you don’t need to declare variables for Events anyway.

As for whether Away3D is a good fit, judging from what you said, yes it seems it would be.

   

rhernando, Newbie
Posted: 21 November 2012 10:08 PM   Total Posts: 2   [ # 2 ]

Thank you for the reply. In fact it was a flash builder thing, it offers to create the variable and i just did it, with that out of the way it worked fine.

Now I would like to abuse a little of your kindness, is it possible to use this class in flash CS4 IDE and interact with it?. I usually use some tween platforms that work great with 2D objects, and like i said in my first post my intention is to mix up 3D objects with 2D objects, for example with text fields, images and the classical rounded corner polygons, so it would be great if I could add the 3D objects and interact with them through the IDE actionscript.

Thank you again,
Best,
Rodrigo.

   

synkarius, Member
Posted: 21 November 2012 11:20 PM   Total Posts: 64   [ # 3 ]

I’d like to help again, but I’m not familiar with CS4.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X