Felipe Bastos
June 20th, 2003, 10:25 PM
I want to combine various setIntervals.
The main Interval (10 sec) calls the function that loads the images.
What I want is to call another Interval (2.5sec) that calls a function that rotate the images (+90 degrees).
Here is the code:
// comando para fullscreen
fscommand("fullscreen", "true");
fscommand("allowscale", "false");
// funcao que attacha mc_loadimg e carrega img
function loadimg () {
var f1 = random(165) + 1;
//f2 = random(48) + 1;
loadMovie(f1 + ".jpg", "_root.conjunto.foto1");
loadMovie(f1 + ".jpg", "_root.conjunto.foto2");
loadMovie(f1 + ".jpg", "_root.conjunto.foto3");
loadMovie(f1 + ".jpg", "_root.conjunto.foto4");
trace ("img# = " + f1);
}
function rotateimg () {
_root.conjunto.foto1._rotation = 90;
_root.conjunto.foto1._x = _x + 300;
_root.conjunto.foto2._rotation = 90;
_root.conjunto.foto2._x = _x + 310;
_root.conjunto.foto3._rotation = -90;
_root.conjunto.foto3._x = _x + 300;
_root.conjunto.foto4._rotation = -90;
_root.conjunto.foto4._x = _x + 310;
trace ("function rotateimg OK");
}
//run the function initially
loadimg();
//use setInterval to run it every 5 seconds after that
setInterval(loadimg, 5000);
setInterval(rotateimg, 2500);
The crazy math that I did is because I reflected the movieclips, so I have to set their _x position after rotating the mcs.
Thanks
:)
The main Interval (10 sec) calls the function that loads the images.
What I want is to call another Interval (2.5sec) that calls a function that rotate the images (+90 degrees).
Here is the code:
// comando para fullscreen
fscommand("fullscreen", "true");
fscommand("allowscale", "false");
// funcao que attacha mc_loadimg e carrega img
function loadimg () {
var f1 = random(165) + 1;
//f2 = random(48) + 1;
loadMovie(f1 + ".jpg", "_root.conjunto.foto1");
loadMovie(f1 + ".jpg", "_root.conjunto.foto2");
loadMovie(f1 + ".jpg", "_root.conjunto.foto3");
loadMovie(f1 + ".jpg", "_root.conjunto.foto4");
trace ("img# = " + f1);
}
function rotateimg () {
_root.conjunto.foto1._rotation = 90;
_root.conjunto.foto1._x = _x + 300;
_root.conjunto.foto2._rotation = 90;
_root.conjunto.foto2._x = _x + 310;
_root.conjunto.foto3._rotation = -90;
_root.conjunto.foto3._x = _x + 300;
_root.conjunto.foto4._rotation = -90;
_root.conjunto.foto4._x = _x + 310;
trace ("function rotateimg OK");
}
//run the function initially
loadimg();
//use setInterval to run it every 5 seconds after that
setInterval(loadimg, 5000);
setInterval(rotateimg, 2500);
The crazy math that I did is because I reflected the movieclips, so I have to set their _x position after rotating the mcs.
Thanks
:)