Posted By

RubenBristian on 01/27/11


Tagged

as3


Versions (?)

Who likes this?

7 people have marked this snippet as a favorite

adrianparr
kure69
onemanstudio
carface
merritt212
makeyko
Josueriv


Draw circle preloader


 / Published in: ActionScript 3
 

  1. //draw circle line for the preloader
  2. var cos:Function=Math.cos;
  3. var sin:Function=Math.sin;
  4. var pi:Number=Math.PI;
  5. var d_r:Number=pi/180;
  6. var r_d:Number=180/pi;
  7. var midPoint:Object={_x:0,_y:0};
  8. var r:Number=11;
  9.  
  10. var pLoaded=Math.round(event.target.bytesLoaded*100/event.target.bytesTotal);
  11.  
  12. mcPreloader.graphics.clear();
  13. mcPreloader.graphics.lineStyle(3);
  14. mcPreloader.graphics.moveTo(11,0);
  15.  
  16. for (var z = 0; z<=pLoaded*3.6; z++) {
  17. mcPreloader.graphics.lineTo((cos(z*d_r)*r), (sin(z*d_r)*r));
  18. }

Report this snippet  

You need to login to post a comment.