home *** CD-ROM | disk | FTP | other *** search
/ Champak 48 / cdrom_image.iso / Games / numbersequence.swf / scripts / DefineSprite_260 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-09-27  |  402 b   |  22 lines

  1. function doAnimation()
  2. {
  3.    var i = 0;
  4.    while(i < g_nStrNum)
  5.    {
  6.       eval("B_Str" + i)._y = 2 - getRandom(5);
  7.       eval("B_Str" + i)._rotation = 8 - getRandom(17);
  8.       i++;
  9.    }
  10. }
  11. function getRandom(nMax)
  12. {
  13.    var nRet = Math.floor(Math.random() * nMax);
  14.    if(nRet == nMax)
  15.    {
  16.       nRet--;
  17.    }
  18.    return nRet;
  19. }
  20. var g_nStrNum = 2;
  21. this.gotoAndPlay(_currentframe + 1);
  22.