Hi, I’m trying to make an actionScripted animation that resembels a data grid.
Right now I’ve already created the grid and what I call “Grid Monkeys” which are little circles that travel the grid. Now I want them to leave a trail as they move. How can I integrate that into my code.
Here is my creation code:
[AS]
function createMonkey(M) {
var Max = M;
for (var i = 0; i<M; i++) {
Total++;
linePick = randomRange(0, yMax);
// 0-500
var m = _root.attachMovie(“probe”, “probe”+Total, Total, {_x:xMax, _y:linePick});
m.onEnterFrame = Move;
}
}
randomRange = function (min, max) {
return Math.floor(Math.random()*(max-min+1))+min;
};
function Move() {
if (this.Decide<=0) {
this.dirPick = randomRange(1, 8);
this.Decide = randomRange(1, 50);
} else {
this.Decide -= 1;
}
if (this.dirPick == 1) {
this.Dir = “Up”;
this.xSpeed = 0;
this.ySpeed = -2;
} else if (this.dirPick == 2) {
this.Dir = “Down”;
this.xSpeed = 0;
this.ySpeed = 2;
} else if (this.dirPick == randomRange(3, 10)) {
this.Dir = “Left”;
this.xSpeed = 2;
this.ySpeed = 0;
}
this._x -= this.xSpeed;
this._y += this.ySpeed;
//createTrail
//this.attachMovie(“trail”, “Trail”+i, this.getNextHighestDepth(), {_x:this._x+3, _y:this._y+4});
}
[/AS]