una cosa del genere
codice:
MovieClip.prototype.funzione= function (x,y,a,sx,sy,steps) {
this.onEnterFrame=function () {
this._xstep=(Number(x)-this._x)/Number(steps);
this._ystep=(Number(y)-this._y)/Number(steps);
this._rot=(Number(a)-this._rotation)/Number(steps);
this._xsca=(Number(sx)-this._xscale)/Number(steps);
this._ysca=(Number(sy)-this._yscale)/Number(steps);
this._steps=steps;
if (this._steps) {
this._rotation+=this._rot;
this._alpha+=10;
this._x+=this._xstep;
this._y+=this._ystep;
this._xscale+=this._xsca;
this._yscale+=this._ysca;
this._steps--;
}
else {
delete this._xstep;
delete this._ystep;
delete this._xsca;
delete this._ysca;
delete this._steps;
delete this.onEnterFrame
}
}
}
function play () {
cl = setInterval(function () {
mc.funzione(200,129 ,0,100,100,6);
clearInterval(cl);}, 2000);
cl1 = setInterval(function () {
mc.funzione(250,200 ,0,100,100,6);
clearInterval(cl1);}, 4000);
c2 = setInterval(function () {
mc.funzione(300,250 ,0,100,100,6);
clearInterval(cl2);}, 6000);
cl3 = setInterval(function () {
mc.funzione(200,129 ,0,100,100,6);
clearInterval(cl3);}, 8000);
}
NumTotale = 1000;
OgniQuantiSecondi = 8 ;
partenza = 1;
function carica() {
partenza = partenza<NumTotale ? partenza+1 : 1;
_root.play();
}
_root.play();
setInterval(this, "carica", OgniQuantiSecondi*1000);
i 2 colori in rosso devono coincidere.