Hi,
i want to add cubic cows to scene, make them running, when it will be far, they go back and run again. I have my own class in external package, it looks like this:
public class Animal extends DisplayObject3D
{
private var body:Cube;
private var ml:MaterialsList = new MaterialsList();
public function Animal(type:String):void {
ml.addMaterial(new BitmapFileMaterial("lieupFiles/animal/"+type+"/side.png"), 'front');
//.....
body= new Cube( ml, 100, 200, 150, 2, 2, 2 );
this.addChild(body);
this.addEventListener(Event.ENTER_FRAME, pohybuj);
}
public function pohybuj(event:Event):void{
trace("asdf asdfas");
event.target.z+=3;
}
}
It works pretty good, but it doesnt add event listener (cubes keep staying at same place) Should i use any special type of Event?
Thanks in advance!