home *** CD-ROM | disk | FTP | other *** search
/ Practical Web Pages 2004 September / PracticalWebPages-WPG13-09-2004-Coverdisc.iso / pc / Software / Toolkit / Sothink SWF Quicker 1.5 / data1.cab / Public_Files / Effects / ActionScript / Rotate / Revolving2.sqe < prev    next >
Encoding:
Text File  |  2004-06-14  |  3.0 KB  |  127 lines

  1. ========== Description Part Begin ==========
  2. name = "Revolving2";
  3. description = "The characters begin to rotate vertically one after another, faster and faster, and finally speed down till stop when the maximum speed is reached.";
  4. version = "1.00";
  5. bin = "Revolving2.bin";
  6. ========== Description Part End ==========
  7.  
  8. ========== Parameter Part Begin ==========
  9. $nCharacterCount(EDIT,INT,1,1 10000,"Total Characters ","The total characters using the special effect. The value is defined by the selected characters in the movie, but can not be changed in the property box.");
  10. $nFrameCount(EDIT,INT,3,3 3,"Total Frames","It indicates the total frames of actions. The total frames of the effect is probably more than it.");
  11. $nInterval(EDIT,INT,5,1 10000,"Interval","The time difference between the former character and the latter one beginning to change.");
  12. $bDirection(LIST,INT,1,"Left":1 "Right":0,"Direction","To control characters to change from left to right, or right to left.");
  13.  
  14. ========== Parameter Part End ==========
  15.  
  16. ========== Function Part Begin ==========
  17. nCharacterCount = 16;
  18. nFrameCount = 8;
  19. nInterval = 5;
  20. bDirection = true;
  21.  
  22.  
  23.  
  24. nIsRun = new Array(nCharacterCount );
  25. nRotateArray = new Array(nCharacterCount);
  26. nRadiusArray = new Array(nCharacterCount);
  27. nStateArray = new Array(nCharacterCount);
  28. nSpeedArray = new Array(nCharacterCount);
  29. bSignArray = new Array(nCharacterCount);
  30.  
  31.  
  32.  
  33. for( i = 1; i <= nCharacterCount; i++)
  34. {
  35.     this["c" + i]._alpha = 100;
  36.     this["c" + i]._rotation = 0;
  37.     this["c" + i]._xscale = 100;
  38.     this["c" + i]._yscale = 100;
  39.     
  40.     nStateArray[i - 1] = 90;
  41.     nSpeedArray[i -1] = 0.1;
  42.     bSignArray[i -1] = true;
  43.  
  44.     if(bDirection)
  45.     {
  46.         if(i == 1)
  47.             nIsRun[0] = 0;
  48.         else
  49.         {
  50.             nIsRun[i - 1] = nIsRun[i - 2];
  51.             nIsRun[i - 1] += nInterval ;
  52.         }
  53.     }
  54.     else
  55.     {
  56.         if(i == 1)
  57.             nIsRun[nCharacterCount -1] = 0;
  58.         else
  59.         {
  60.             nIsRun[nCharacterCount - i] = nIsRun[nCharacterCount - (i -1) ];
  61.             nIsRun[nCharacterCount - i] += nInterval ;
  62.         }
  63.         
  64.     }
  65. }
  66.  
  67.  
  68.  
  69.  
  70. function fun()
  71. {
  72.     
  73.     for (i = 1; i <= nCharacterCount; i++)
  74.     {
  75.         if(nIsRun[i -1] < 0)
  76.         {
  77.              this["c" + i]._xscale = Math.sin(nStateArray[i -1]) * 100;
  78.              nStateArray[i -1] += (nDirection?     nSpeedArray[i -1] : -nSpeedArray[i -1]);
  79.  
  80.              if(bSignArray[i - 1])
  81.              {
  82.                  nSpeedArray[i -1] += 0.02;
  83.                 if(nSpeedArray[i -1] > 1)
  84.                     bSignArray[i -1] = false;
  85.              }
  86.             else
  87.             {
  88.                 nSpeedArray[i -1] -= 0.01;
  89.                 if(nSpeedArray[i -1] < 0)
  90.                     bSignArray[i -1]= true;
  91.  
  92.             }
  93.         }
  94.         nIsRun[i -1] --;
  95.     } 
  96.  
  97.       for (i = 1; i <= nCharacterCount; i++)
  98.     {
  99.          if(this["c" + i]._alpha >= 0)
  100.             return;
  101.         
  102.     }
  103.     
  104.     
  105.     for (i = 1; i <= nCharacterCount; i++)
  106.     {
  107.         this["c" + i]._x = nCentreXArray[i -1];
  108.         this["c" + i]._y = nCentreYArray[i -1];
  109.  
  110.         gotoAndPlay(1);
  111.     }
  112.  
  113.  
  114. function again()
  115. {
  116.     gotoAndPlay(2);
  117. }
  118.  
  119. ========== Function Part End ==========
  120.  
  121. ========== Frame Part Begin ==========
  122. $frame(fun,1,-1,"fun");
  123. $frame(fun,2,-1,"fun");
  124. $frame(again,3,-1,"again");
  125. ========== Frame Part End ==========