ciao a tutti,
ho qualche problemino con un'animazione del mouse.
Una prova è www.ddes.it
Qui tutto sembra filare liscio. Il problema è quando uso quasta animazione su di un sito completo costituito da un unico filmato flash.
Su tre MAC tutto funziona sui Win l'animazione non segue il puntatore ma funziona a scatti.
Di seguito il codice:
Fotogramma 1:
i = 1;
_root.start_xpos = _xmouse; //fornisce le posizioni iniziali
_root.start_ypos = _ymouse;
Fotogramma 2:
//vengono creati due gruppi di stelline fino ad un massimo di 40 e animate in modo random
// ad ogni passaggio da questo fotogramma vengono create una stelina del gruppo 1 e una stellina del gruppo 2
import mx.transitions.Tween;
import mx.transitions.easing.*;
this.attachMovie("primitiva_mc", "primitiva_" + i, 900 + i);
this.attachMovie("primitiva_mc", "primitivaa_" + i, 940 + i);
onMouseMove = function()
{
_root.start_xpos = _xmouse;
_root.start_ypos = _ymouse;
}
rad = 10 + Math.random() * 40;
fin_angle = Math.random() * 360;
xfin = _xmouse + rad * Math.cos(fin_angle);
yfin = _ymouse + rad * Math.sin(fin_angle);
dec = Math.random() * 20;
rada = Math.random() * 60;
fin_anglea = Math.random() * 360;
xfina = _xmouse + rada * Math.cos(fin_anglea);
yfina = _ymouse + rada * Math.sin(fin_anglea);
deca = Math.random() * 20;
this["ntweenx_" + i] = new Tween(this["primitiva_" + i], "_x", Strong.easeOut, _root.start_xpos , xfin, 4, true);
this["ntweeny_" + i] = new Tween(this["primitiva_" + i], "_y", Strong.easeOut, _root.start_ypos , yfin, 4, true);
this["ntweena_" + i] = new Tween(this["primitiva_" + i], "_alpha", Strong.easeOut,100 , 0, dec, true);
this["ntweenxa_" + i] = new Tween(this["primitivaa_" + i], "_x", Strong.easeOut, _root.start_xpos , xfina, 4, true);
this["ntweenya_" + i] = new Tween(this["primitivaa_" + i], "_y", Strong.easeOut, _root.start_ypos , yfina, 4, true);
this["ntweenaa_" + i] = new Tween(this["primitivaa_" + i], "_alpha", Strong.easeOut,100 , 0, deca, true);
Fotogramma 3:
azzera il contatore per evitare di superare le 40 stelline per gruppo e rientra nel loop
i++;
if(i == 40)
{
i = 1;
}
gotoAndPlay(2);
Dove sbaglio?
Un saluto