I am experimenting with setInterval and trying to set a delay (of 1 millisecond) on the increment of a variable (i), but i'm not sure where to position the script (and have doubts the setInterval script is correct).
here's the script (summary):
var int_x=100
var int_y=0
var right_x = int_x+200;
var down_y = int_y+200;
//start setInterval loop
i = new Object();
i.interval = function(){
trace(i)
}
setInterval( i, "interval", 1);
//increment statement (a loop)
for (var i=0; i<=100; i++ //this is the variable i want to delay){
var movie = _root.createEmptyMovieClip("square", 1);
with (movie) {
moveTo (int_x,int_y);
lineStyle(2, 0x04263E, 100);
beginFill (0x0C6AAF, 70);
lineTo(right_x + i, int_y);
lineTo(right_x + i, down_y + i);
lineTo (int_x, down_y + i);
lineTo (int_x, int_y);
endFill;
}
}
It seems that setInterval comes as an addition to a function, I wish it was just an addition to a variable...
Hope you understand me and hope you can give me a hand with this.
Greetz