Comunidad de diseño web y desarrollo en internet online

Invertir movieClip y pausarlo en determinado lugar

Citar            
MensajeEscrito el 02 Jun 2010 12:42 pm
Hola:

Estoy empezando con esto de AS3 y muchas dudas las resuelvo leyendo este foro, pero me ha surgido una que no encuentro.

Estoy haciendo una animación, concretamente un timeline.

El caso es que con timeline.reverse() puedo reproducirlo al reves, pero entero.

Me gustaría saber como poder parar de alguna manera ese timeline una vez invertido, y sea por algun label o tiempo...

Gracias.

Por noumeno

7 de clabLevel



 

firefox
Citar            
MensajeEscrito el 02 Jun 2010 01:58 pm
¿Quieres parar por tiempo o en un fotograma en concreto?

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 02 Jun 2010 05:22 pm
Pues la verdad,ni yo mismo se como es mejor, por lo que pongo el código a ver que solución es mejor:

Código :

var timeline:TimelineLite = new TimelineLite();

timeline.insert(TweenLite.to(ninio, 1, {x:200,y:200,scaleX:0.05, scaleY:0.05,alpha:1}));
timeline.insert(TweenLite.to(home, 1, {x:240,y:190,scaleX:0.1, scaleY:0.1,alpha:1, delay:0.5}));
timeline.insert(TweenLite.to(cabeza, 1, {x:300,y:200,scaleX:0.2, scaleY:0.2,alpha:1,delay:1}));
timeline.insert(TweenLite.to(menu, 1, {x:500,y:200,scaleX:1, scaleY:1,alpha:1,delay:1.5}));

timeline.appendMultiple([
               new TweenLite(ninio, 1, {alpha:1}),
               new TweenLite(home, 1, {alpha:1}),
               new TweenLite(cabeza, 1, {alpha:1}),
               new TweenLite(menu, 1, {alpha:1})]);

timeline.addLabel("cajaHome",1.5);

home.addEventListener(MouseEvent.CLICK,irHome); 
function irHome(Event:MouseEvent){
   timeline.reverse();
         ???????
}


Es una timeline, lo que quiero hacer es que cuando haga click en HOME, por ejemplo, la timeline se reproduzca al revés y pare en ese punto.

Gracias

Por noumeno

7 de clabLevel



 

firefox
Citar            
MensajeEscrito el 03 Jun 2010 02:16 am
En el fotograma donde quieres que pare pon esto

if(reverse) stop()

En el fotograma nro 1 pon

var reverse:Boolean = false;

Y modifica el code que pusiste así:

Código ActionScript :

function irHome(Event:MouseEvent){
   reverse = true;
   timeline.reverse();
 }


Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 03 Jun 2010 07:24 am
Y por tiempo como sería??

Voy a consultar mi duda detalladamente:

Tengo un TIMELINE y dentro de ella 4 MOVIECLIPS. Un movieclip de 1 único fotograma y sus 3 copias. Hecho mediante código.

TIMELINE.MC1 bola que se desplaza de izq a derecha
TIMELINE.MC2 bola que se desplaza de izq a derecha
TIMELINE.MC3 bola que se desplaza de izq a derecha
TIMELINE.MC4 bola que se desplaza de izq a derecha

Lo que quiero es que al pinchar sobre mc2 se ejecute el TIMELINE pero al reves hasta llegar a TIMELINE.MC2
TIMELINE.MC4 bola que se desplaza de DERECHA a izquierda
TIMELINE.MC3 bola que se desplaza de DERECHA a izquierda
TIMELINE.MC2 bola que se desplaza de DERECHA a izquierda

y pare.

No hay frames dibujados, solo el primero MC1.

Muchas gracias por tu tiempo.

Por noumeno

7 de clabLevel



 

firefox
Citar            
MensajeEscrito el 03 Jun 2010 09:32 am
Si quiero que se detenga a los 10 segundos es algo así:

Código ActionScript :

function irHome(Event:MouseEvent){ 
   var para:Number = setInterval(function(w){
        w.stop()
        clearInterval(para)
    }, 10000, this);
   timeline.reverse(); 
 }


Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 03 Jun 2010 11:09 am
Me dice lo siquiente::

Código :

TypeError: Error #1006: stop no es una función.
   at MethodInfo-338()
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at SetIntervalTimer/onTimer()
   at flash.utils::Timer/_timerDispatch()
   at flash.utils::Timer/tick()



Ya me pierdo...

Muchisimas gracias

Por noumeno

7 de clabLevel



 

firefox
Citar            
MensajeEscrito el 03 Jun 2010 02:01 pm
Hazle un cast

MovieClip(w).stop()

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 03 Jun 2010 05:49 pm
Pues no ha habido suerte:

Código :

TypeError: Error #1034: Error de conversión forzada: no se puede convertir global@3dc3b0b1 en flash.display.MovieClip.
   at MethodInfo-365()
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at SetIntervalTimer/onTimer()
   at flash.utils::Timer/_timerDispatch()
   at flash.utils::Timer/tick()



Que desesperación... al final lo voy a tener que hacer por linea de tiempo... joer...

Por noumeno

7 de clabLevel



 

firefox
Citar            
MensajeEscrito el 04 Jun 2010 10:17 am
Ok, usa otro timer que llame a una función que solo haga stop

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox

 

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