(EL PRINCIPAL PROBLEMA QUE ME DA ES QUE NO ME ACEPTA EL CORCHETE FINAL DE LO DE SI COINCIDEN LA X Y LA Y DEL OBJETO Y EL RATON, QUE ES EL CORCHETE SITUADO AL FINAAAAAAAAL DEL TODO, EL CUAL ME DICE QUE NO PINTA NADA, CUANDO LO QUE QUIERO ES CERRAR LA FUNCION DE CUANDO COINCIDAN ESTAS CIRCUNSTANCIAS...) GRACIAS POR AYUDARME POR ADELANTADO!!
dead = false;
speedR = 0;
speedL = 0;
speedD = 0;
speedU = 0;
top_speed = 10;
decay = 0.1;
accel_x = 0.25 * (Math.cos(Math.cos((_root._xmouse - this._x)*0.1));
if (accel_x<0) {
accel_x = -accel_x }
accel_y = 0.25 * (Math.sin(Math.sin((_root._ymouse - this._y)*0.1));
if (accel_y<0) {
accel_y = -accel_y }
}
onClipEvent (mouseMove) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)){
// Right Control ---------------------------------------------------------------
if (this._x<430) {
if (speed<top_speed) {
speedR += accel_x
}
this._x += speedR;
} else if (this._x<_root._xmouse) {
speedR = 0
} else if (this._x>430) {
speedR = 0;
this._x = 430
} else if (speedR<0) {
speedR = 0;
} else {
if (speedR>0) {
speedR -= decay;
}
this._x += speedR;
}
// Left Control ---------------------------------------------------------------
if (this._x>20) {
if (speed<top_speed) {
speedL += accel_x
}
this._x -= speedL;
} else if (this._x>_root._xmouse) {
speedL = 0
} else if (this._x>20) {
speedL = 0;
this._x = 20
} else if (speedL<0) {
speedL = 0;
} else {
if (speedL>0) {
speedL -= decay;
}
this._x -= speedR;
}
// Down Control -------------------------------------------------------------
if (this._y<620) {
if (speed<top_speed) {
speedD += accel_y
}
this._y += speedD;
} else if (this._y<_root._ymouse) {
speedD = 0
} else if (this._y>620) {
speedD = 0;
this._y = 620
} else if (speedD<0) {
speedD = 0;
} else {
if (speedD>0) {
speedD -= decay;
}
this._y += speedD;
}
// Up Control ---------------------------------------------------------------
if (this._y>20) {
if (speed<top_speed) {
speedU += accel_y
}
this._y -= speedU;
} else if (this._y>_root._ymouse) {
speedU = 0
} else if (this._y>20) {
speedU = 0;
this._y = 20
} else if (speedU<0) {
speedU = 0;
} else {
if (speedU>0) {
speedU -= decay;
}
this._y -= speedU;
}
}
[hernán]Puse la etiqueta code, es más fácil leerlo así[/hernán]
