Advertisement
ealbinu

Tween

Nov 2nd, 2012
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import fl.transitions.Tween;
  2. import fl.transitions.easing.*;
  3. import flash.events.MouseEvent;
  4.  
  5. slide1_mc.addEventListener(MouseEvent.CLICK, irASlide2);
  6. slide2_mc.addEventListener(MouseEvent.CLICK, irASlide3);
  7. slide3_mc.addEventListener(MouseEvent.CLICK, irASlide1);
  8.  
  9. function irASlide1(e:MouseEvent){
  10.     new Tween(slide3_mc, "x", Regular.easeOut, 0, -550, 1, true);
  11.     new Tween(slide1_mc, "x", Elastic.easeOut, 550, -0, 1, true);
  12. }
  13. function irASlide2(e:MouseEvent){
  14.     new Tween(slide1_mc, "x", Regular.easeOut, 0, -550, 1, true);
  15.     new Tween(slide2_mc, "x", Elastic.easeOut, 550, -0, 1, true);
  16.    
  17.     new Tween(slide2_mc.nube_mc, "scaleX", Elastic.easeOut, 0, 1, 3, true);
  18.     new Tween(slide2_mc.nube_mc, "scaleY", Elastic.easeOut, 0, 1, 3, true);
  19. }
  20. function irASlide3(e:MouseEvent){
  21.     new Tween(slide2_mc, "x", Regular.easeOut, 0, -550, 1, true);
  22.     new Tween(slide3_mc, "x", Elastic.easeOut, 550, -0, 1, true);
  23. }
  24.  
  25. //Animar objeto dentro de otro movieclip (slide)
  26. slide1_mc.animacion_mc.stop();
  27. slide1_mc.animacion_mc.addEventListener(MouseEvent.ROLL_OVER, correrAnimacion);
  28. slide1_mc.animacion_mc.addEventListener(MouseEvent.ROLL_OUT, detenerAnimacion);
  29. function correrAnimacion(e:MouseEvent){
  30.         //e.currentTarget hace referencia al movieclip que este ejecutando la funcion
  31.         e.currentTarget.play();
  32.     }
  33. function detenerAnimacion(e:MouseEvent){
  34.         e.currentTarget.stop();
  35.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement