styleBunny
Technical User
hi gang,
i have this much script on the last frame of my timeline, where i want a movie sprite to do 5 random moves on the time line, then return to a specified postion
a = setInterval(pause, 40); //calls a function with .4 sec interval
//this function will do 5 random moves then set sprite to a fixed position.
function pause() {
for (y=0; y<5; y++) {
afnText._y = random(150);
afnText._x = random(150);
}
afntext._y = 200
afntext._x =150
}
clearInterval(a);
stop();
i cant work out where my clearInterval should go? it either doesnt work and the for loop keeps on going or it wont go at all.
Is what im trying to do possible? call a function from a frame script?
i have this much script on the last frame of my timeline, where i want a movie sprite to do 5 random moves on the time line, then return to a specified postion
a = setInterval(pause, 40); //calls a function with .4 sec interval
//this function will do 5 random moves then set sprite to a fixed position.
function pause() {
for (y=0; y<5; y++) {
afnText._y = random(150);
afnText._x = random(150);
}
afntext._y = 200
afntext._x =150
}
clearInterval(a);
stop();
i cant work out where my clearInterval should go? it either doesnt work and the for loop keeps on going or it wont go at all.
Is what im trying to do possible? call a function from a frame script?