Ver Mensaje Individual
  #10 (permalink)  
Antiguo 25/06/2010, 16:13
evo_it
 
Fecha de Ingreso: mayo-2010
Ubicación: Argentina
Mensajes: 61
Antigüedad: 14 años
Puntos: 6
Respuesta: Mover movie clip con funcion en boton

Lo que necesitas es que al llegar arriba se destruya el evento onEnterFrame. Aquí te muestro cómo destruir el evento onEnterFrame:

Presta atención a la línea número 15.

Código actionscript:
Ver original
  1. sumarY = 4;
  2. btn_mision_vision.onRelease = function ()
  3. {
  4.     contenedor.onEnterFrame = function ()
  5.     {
  6.         this._y += sumarY;
  7.        
  8.         trace(this._y)
  9.         if (this._y > 800)
  10.         {
  11.             sumarY = sumarY * -1;
  12.         }
  13.         else if (this._y < 5)
  14.         {
  15.             delete this.onEnterFrame           
  16.         }      
  17.     };
  18. };



Espero que te sirva, saludos.