Hello, I'm trying to use the PathAnimator (http://away3d.com/tutorials/
tutorial-how-to-use-the-pathanimator-class). Flash (cs4, v10 player,
away 3.3.3),  is complaining about referencing to a null object,
here's the code i'm using:


import away3d.animators.PathAnimator;
import away3d.animators.data.Path;
import away3d.containers.*;
import away3d.core.base.*;
import away3d.primitives.*;
import away3d.core.math.*;
import away3d.materials.*;


//setup
var view:View3D = new View3D({x:300, y:200});
addChild(view);


//path definition
var aPath:Array = [
new Number3D(-1000, -1000, -2000),
new Number3D(-1000, 0, 0),
new Number3D(1000, 0, 0),
new Number3D(1000, 1000, -2000)];
var p:Path = new Path(aPath);


//object to travel path
var mat:IMaterial = new BitmapMaterial(new BitmapData(64,64, false,
0xFF0000));
this.cube = new Cube({material:mat, width:200, height:80, depth:100});
view.scene.addChild(this.cube);



//animator definition
var init:Object = {     duration:5000,
lookat:false,
aligntopath:true,
targetobject:null,
offset:new Number3D(0,100,0),
rotations:null,
fps:24,
easein:false ,
easeout:false};
//var pathanimator = new PathAnimator
var pathanimator = new PathAnimator(p, this.cube, init);


//cube @ 50% of path
this.pathanimator.update(0.5);
view.camera.lookAt(this.cube.position);
view.render();



According to debugger, offending line is:
this.pathanimator.update(0.5);

What am I doing wrong?

Thanks in advance.

Fran.

Reply via email to