home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 165 / XENIATGM165.ISO / cddata / upframe.cxt / 00003_topMenu3.swf / scripts / DefineSprite_23 / frame_1 / DoAction.as
Encoding:
Text File  |  2003-03-06  |  504 b   |  24 lines

  1. function nuRotation(id)
  2. {
  3.    this["r" + id].rf = Math.random() * 720 - 360;
  4.    this["r" + id].count = Math.random() * 150;
  5. }
  6. var i = 1;
  7. while(i < 5)
  8. {
  9.    this["r" + i]._rotation = Math.random() * 360;
  10.    this["r" + i].id = i;
  11.    nuRotation(i);
  12.    this["r" + i].onEnterFrame = function()
  13.    {
  14.       this.dr = (this.rf - this._rotation) / 30;
  15.       this._rotation += this.dr;
  16.       this.count--;
  17.       if(this.count < 0)
  18.       {
  19.          nuRotation(this.id);
  20.       }
  21.    };
  22.    i++;
  23. }
  24.