Hi, i m starting my first project with away3d and as3.
i have some troubles trying to adding objects at runtime to later move
them with mouse.How can i put for example 10 objects(cubes) and click
them later? i have an error
i have the this code:
package
{
import away3d.cameras.*;
import away3d.containers.*;
import away3d.materials.*;
import away3d.primitives.*;
import flash.display.*;
import flash.events.*;
[SWF(width = "800",height = "600")]
public class Test1 extends Sprite
{
protected var _view:View3D;
var nume:Number=0;
public function Test1()
{
_createView();
_createScene();
_createCamera();
}
protected function _createView():void
{
_view = new View3D ;
addChild(_view);
_view.x = 400;
_view.y = 300;
addEventListener(Event.ENTER_FRAME,_onEnterFrame);
}
protected function _createScene():void
{
var scene:Scene3D = new Scene3D ;
_view.scene = scene;
}
protected function _createCamera():void
{
}
private function armarCubos(){
for(var i=0;i<10;i++){
var cube:Cube= new Cube() ;
cube.width=20;
cube.x = 30*i;
cube.material = new WireColorMaterial(0x333333);
scene.addChild(cube); /*----ERROR----*/
}
}
protected function _onEnterFrame(ev:Event):void
{
nume++;
if(nume==100){
armarCubos();
}
_view.render();
}
}
}
i have this error:
1120: Access of undefined property scene.
thanks