Advertisement
Guest User

Untitled

a guest
Apr 13th, 2011
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. totalclips = 65;
  2. clipnumber = 1;
  3. // hide all 65 clips on the stage:
  4. for(i=1; i<=65; i++){
  5.     this["myclip"+i+"_mc"]._visible = false;
  6. }
  7.  
  8. animation = function(who){
  9.     who._visible = true; // shows the clip to be animated
  10.     new mx.transitions.Tween(who, "_alpha", mx.transitions.easing.None.easeNone, 0, 100, 30, false);
  11.     var scaleup = new mx.transitions.Tween(who, "_yscale", mx.transitions.easing.None.easeNone, 150, 0, 150, false);
  12.     var scaleup = new mx.transitions.Tween(who, "_xscale", mx.transitions.easing.None.easeNone, 150, 0, 150, false);
  13.     scaleup.onMotionChanged = function(){
  14.         // this checks to see if we are frame 120 of the scale animation, if so we start to fade out.
  15.         if(scaleup.time == 120){
  16.             new mx.transitions.Tween(who, "_alpha", mx.transitions.easing.None.easeNone, 100, 0, 30, false);
  17.         }  
  18.     }
  19.     scaleup.onMotionFinished = function(){
  20.         // this is run if we reach the end of the scaling up animation
  21.         // we then add 1 to the clipnumber:
  22.         clipnumber++; // adds 1 to the clip number
  23.         // if the clipnumber is greater than 65. we do nothing and this code loop stops.
  24.         if(clipnumber == 66){
  25.             // do nothing - it's finished animating all 65.
  26.         }else{
  27.             // 'else' = so we are below 65 so we send the next clip to the animation code:
  28.             animation(this["myclip"+clipnumber+"_mc"]);
  29.         }
  30.     }
  31. }
  32. //to start animating all 65 clips, start with clip number 1"
  33. animation(myclip1_mc);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement