tengo una animacion de unos petalos de rosas, que al poner el mouse sobre ellas se deslizan hacia un lado y giran..
el problema es que aveces no paran de girar...
este es el codigo:
Código:
onClipEvent(load){
_x=random(550);
_y=random(150);
this.useHandCursor=false;
this._rotation=random(180);
}
onClipEvent (enterFrame) {
_rotation += (rot[ar]-_rotation)/10;
_x += (xPos[a]-_x)/10;
_y += (yPos[ai]-_y)/10;
if (ar == 1) {
if (_rotation+rot[1]>rot[1]) {
rot[0] = this._rotation;
}
}
if (a == 1) {
if (_x+50>=xPos[1]) {
xPos[0] = this._x;
}
if (_y>=yPos[1]) {
yPos[0] = this._y;
}
}
if (a == 2) {
if (_x-50<=xPos[2]) {
xPos[0] = this._x;
}
if (_y>=yPos[2]) {
yPos[0] = this._y;
}
}
}
on (rollOver) {
xPos = new Array(this._x, this._x+50, this._x-50);
yPos = new Array(this._y, this._y+50, this._y-50);
rot = new Array(0, _rotation+random(180));
this.a = random(2)+1;
this.ai = random(2)+1;
this.ar = 1;
agua.play();
}
Hay una serie de if que puse por recomendaciones de un amigo, los deje para no herir su orgullo...
Ojalas alguien me eyude a pararlos... jajaja
Saludos
Mkls