Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/09/2010, 12:31
polo_W12
 
Fecha de Ingreso: enero-2008
Ubicación: Concepción, Chile
Mensajes: 76
Antigüedad: 16 años, 3 meses
Puntos: 3
Respuesta: Controlar en secuencia varios (TweenEvent) en una misma función as3

Amigo:

Mira se me ocurren un par de ideas pero no tengo mucho tiempo, a mí en lo personal se me ocurre algo para darte una idea pero solo te doy las bases el código es el siguiente:

Código ACTIONSCRIPT:
Ver original
  1. import fl.transitions.Tween;
  2. import fl.transitions.easing.*;
  3. import fl.transitions.TweenEvent;
  4.  
  5. var i:uint                          = 0;
  6. var t:uint                          = 6;
  7. var xclips:Array                    = new Array();
  8. var c:uint                          = 0;
  9.  
  10. initthis();
  11.  
  12. function initthis():void{
  13.     var formato:TextFormat          = new TextFormat();
  14.     formato.font                    = "Verdana";
  15.     formato.size                    = 14;
  16.     formato.color                   = 0x000000;
  17.     for(i=0; i<t; i++){
  18.         var clip:MovieClip          = new MovieClip();
  19.         var texto:TextField         = new TextField();
  20.         texto.autoSize              = TextFieldAutoSize.LEFT;
  21.         texto.defaultTextFormat     = formato;
  22.         texto.selectable            = false;
  23.         texto.antiAliasType         = AntiAliasType.ADVANCED;      
  24.         texto.text                  = "Movie "+i;
  25.         clip.addChild(texto);
  26.         this.addChild(clip);
  27.         xclips.push(clip);
  28.     }
  29.     movingxclip(xclips[c]);
  30. }
  31.  
  32. function movingxclip(a:MovieClip):void{
  33.     var moving:Tween = new Tween(a, "x", Strong.easeInOut, 0, 300, 2, true);
  34.     moving.addEventListener(TweenEvent.MOTION_FINISH, motionfinish);
  35. }
  36.  
  37. function motionfinish(a:TweenEvent){
  38.     c++;
  39.     movingxclip(xclips[c]);
  40. }

Solo debes crear un nuevo archivo ActionScript3 y luego copias el código.

Espero te sea de ayuda.
Saluda Atte.
Claudio Barrera Asencio.