Comunidad de diseño web y desarrollo en internet online

problema onClipEvent (enterFrame)

Citar            
MensajeEscrito el 24 Feb 2009 03:34 am
Hola
necesito ayuda con un codigo de as

estoy moviendo un movieclip a traves de un boton, y en el movieclip tengo el siguiente codigo:

onClipEvent (load) {
tarX = 116;
tarY = 0;
rate = 0.29999999999999999;
}
onClipEvent (enterFrame) {
this._x += rate*(tarX-this._x);
this._y += rate*(tarY-this._y);
}


en el boton tengo el siguiente:

on (release) {
trace(_root.pan.tarX);
_root.pan.tarX -= 413.9;
_root.pan.tarY = 0;
}


El problema esta en que quiero que en cierto punto de la posicion en x, al hacer click en el boton el movieclip no se mueva mas, es decir, anular el enterFrame.

Espero haber explicado bien, y ojala alguien me pueda ayuda ,
Gracias :D

Por ojkr123

1 de clabLevel



 

firefox
Citar            
MensajeEscrito el 24 Feb 2009 07:22 am
pdorias intentar algo como:

Código ActionScript :

onClipEvent (load) {
tarX = 116;
tarY = 0;
rate = 0.29999999999999999;
mover = true;
}

onClipEvent (enterFrame) {
if( this.mover )
{
this._x += rate*(tarX-this._x);
this._y += rate*(tarY-this._y);
}
}

y el boton que detiene el movimiento:

Código ActionScript :

on (release) {
_root.pan.mover = false;
}


:D

Por LongeVie

Claber

1741 de clabLevel

1 tutorial

Genero:Masculino  

En un lugar, re moto.

firefox
Citar            
MensajeEscrito el 24 Feb 2009 04:25 pm
Tienes que usar alguna condición que tome una decisión basada en determinado valor para _X.
Se podría colocar tanto en el evento de boton, como en el enterFrame.
Suerte.

Por gustavogarzon

166 de clabLevel



 

firefox
Citar            
MensajeEscrito el 25 Feb 2009 05:16 am
wow... muchas gracias, problemas solucionao. :cool:

Por ojkr123

1 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.