Ok, this is what I have now:
function turnAround() {
villager_speed = -.3;
turn = setInterval(walkAround, 2000);
look = 'right';
}
function walkAround(num) {
villager_speed = .3;
look = 'left';
setInterval(turnAround, 2000);
clearInterval(turn);
this['villager_'+num].onEnterFrame = function() {
if(look == 'right') { this.gotoAndStop(2); } else {
this.gotoAndStop(1); }
this._x -= villager_speed;
}
}
walkAround(1);
walkAround(2);
stop();
But after a minute (estimating), the villagers stop listening
to the function and start flipping random directions. Also, how do
you make it so it will make each villager turn at a random time?
Thanks