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 / Combination / Combination3.sqe < prev   
Encoding:
Text File  |  2004-06-14  |  4.4 KB  |  201 lines

  1. ========== Description Part Begin ==========
  2. name = "Combination3";
  3. description = "Four groups of characters, forming into four circles, are combined into one in the end.";
  4. version = "1.00";
  5. bin = "Combination3.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,5,5 5,"Total Frames","It indicates the total frames of actions. The total frames of the effect is probably more than it.");
  11.  
  12. $nRadius(EDIT,INT,110,0 1000,"Radius","The radius of the arc, which consists of characters.");
  13. $nInterval(EDIT,INT,5,0 1000,"Interval","The time difference between the former character and the latter one beginning to change.");
  14. $nAlphaSpeed(EDIT,INT,3,0 1000,"Fading Speed","The speed of character fading.");
  15.  
  16.  
  17. ========== Parameter Part End ==========
  18.  
  19. ========== Function Part Begin ==========
  20. nFrameCount = 5;
  21. nCharacterCount = 13;
  22.  
  23. nRadius = 140;
  24. nInterval = 5;
  25. nAlphaSpeed = 3;
  26.  
  27.  
  28. nIsRun = new Array(nCharacterCount);
  29. nRotateArray = new Array(nCharacterCount);
  30. nRadiusArray = new Array(nCharacterCount);
  31. nCentreX = new Array(nCharacterCount);
  32. nCentreY = new Array(nCharacterCount);
  33.  
  34. nOldPosX = new Array(nCharacterCount);
  35. nOldPosY = new Array(nCharacterCount);
  36.  
  37.  
  38. for(i = 1;i <= nCharacterCount;i++)
  39. {
  40.     if(i <= nCharacterCount/2)
  41.         nRotateArray[i - 1] = 225;
  42.     else
  43.         nRotateArray[i - 1] = 315;
  44.     nRadiusArray[i - 1]  = nRadius;
  45.     
  46.     if(i <= nCharacterCount/2)
  47.         this["c" + i]._x -= nRadius;
  48.     else
  49.         this["c" + i]._x += nRadius;
  50.     
  51.     nOldPosX[i - 1] = this["c" + i]._x;
  52.     nOldPosY[i - 1] = this["c" + i]._y;
  53.     
  54.     if(i == 1 || i == nCharacterCount)
  55.     {
  56.             nIsRun[0] = 0;
  57.             nIsRun[nCharacterCount -1] = 0;
  58.     }
  59.     else
  60.     {
  61.             if(i <= nCharacterCount/2)
  62.             {
  63.                 nIsRun[i - 1] = nIsRun[i - 2];
  64.                 nIsRun[i - 1] += nInterval;
  65.             }
  66.             else
  67.             {
  68.                 multiple = nCharacterCount - i ;
  69.                 nIsRun[i - 1] = multiple * nInterval;
  70.                 //nIsRun[i -1] = nIsRun[nCharacterCount - i];
  71.             }
  72.     }
  73.     this["c" + i]._alpha = 50;
  74.     
  75.     
  76.     this["c" + i].duplicateMovieClip("cc" + i + i,i);
  77.     
  78.     this["cc" + i + i]._y += nRadius;
  79.     this["c" + i]._y -= nRadius;
  80.     
  81.     this["c" + i]._visible = false;
  82.     this["cc" + i + i]._visible = false;
  83.  
  84.     
  85. }
  86.  
  87.  
  88. function fadeout()
  89. {
  90.     if(c1._alpha < 0)
  91.         gotoAndPlay(1);
  92.     for(i = 1;i <= nCharacterCount;i++)
  93.     {
  94.         this["c" + i]._alpha -= nAlphaSpeed;
  95.         this["cc" + i + i]._alpha -= nAlphaSpeed;        
  96.     }    
  97.     
  98.     
  99.     
  100.     
  101. }
  102.  
  103.  
  104.  
  105. function FadeoutAgain()
  106. {
  107.     gotoAndPlay(4);
  108. }
  109.  
  110. function IsAllCharacterEnd()
  111. {
  112.     bIsEnd = true;
  113.     for(n = 1;n <= nCharacterCount;n++)
  114.     {
  115.         if(this["c" + n]._alpha != 100)
  116.         {
  117.             bIsEnd = 0;
  118.             break;
  119.         }
  120.     }
  121.  
  122.     if(bIsEnd)
  123.         gotoAndPlay(4);
  124.     
  125. }
  126.  
  127.  
  128. function fun()
  129. {
  130.     for(i = 1;i <= nCharacterCount;i++)
  131.     {
  132.         if(nIsRun[i -1] < 0)
  133.         {
  134.             this["c" + i]._visible = true;
  135.             this["cc" + i + i]._visible = true;
  136.             
  137.             //?¿┤¿«Dª╠???¿ª?ª╠?ª╠¿▓¿░????íÑí┴í┬?¿ó¿║?
  138.  
  139.             IsAllCharacterEnd();
  140.             
  141.         
  142.             this["c" + i]._x = Math.cos(Math.PI / 180 * nRotateArray[i -1]) * nRadiusArray[i -1]  + nOldPosX[i -1];
  143.             this["cc" + i + i]._x = Math.cos(Math.PI / 180 * (360 - nRotateArray[i -1])) * nRadiusArray[i -1]  + nOldPosX[i -1];
  144.                 
  145.             this["c" + i]._y = Math.sin(Math.PI / 180 * nRotateArray[i -1]) * nRadiusArray[i -1]  + nOldPosY[i -1];
  146.             this["cc" + i + i]._y = Math.sin(Math.PI / 180 * (360 - nRotateArray[i -1])) * nRadiusArray[i -1]  + nOldPosY[i -1];
  147.                 
  148.             if(i <= nCharacterCount / 2)
  149.             {
  150.                 nRotateArray[i -1] += 5;
  151.                 if(nRotateArray[i -1] > 360)
  152.                 {
  153.                     this["c" + i]._alpha = 100;
  154.                     this["cc" + i + i]._alpha = 100;
  155.                     nRotateArray[i -1] = 360;
  156.                 }
  157.             }
  158.             else
  159.             {
  160.                 nRotateArray[i -1] -= 5;
  161.                 if(nRotateArray[i -1] < 180)
  162.                 {
  163.                     this["c" + i]._alpha = 100;
  164.                     this["cc" + i + i]._alpha = 100;
  165.                     nRotateArray[i -1] = 180;
  166.                 }
  167.             }
  168.                 
  169.  
  170.         }
  171.         else
  172.             nIsrun[i -1]--;
  173.     }
  174.  
  175. }
  176.  
  177.  
  178.  
  179. function again()
  180. {
  181.     gotoAndPlay(2);
  182. }
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189. ========== Function Part End ==========
  190.  
  191. ========== Frame Part Begin ==========
  192. $frame(fun,1,-1,"fun");
  193. $frame(fun,2,-1,"fun");
  194. $frame(again,3,-1,"again");
  195. $frame(fadeout,4,-1,"fadeout");
  196. $frame(FadeoutAgain,5,-1,"fadeout again");
  197.  
  198. ========== Frame Part End ==========
  199.  
  200.