Posted By


alexaivars on 08/17/09

Tagged


Statistics


Viewed 81 times
Favorited by 1 user(s)

Sinuswave circles


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. package {
  2. import flash.display.Sprite;
  3. import flash.events.Event;
  4. [SWF(width="400", height="200", backgroundColor="0x000000", frameRate="30")]
  5. public class FlashTest extends Sprite {
  6. private var time:int = 0;
  7.  
  8. public function FlashTest() {
  9. // write as3 code here..
  10. Init();
  11. }
  12.  
  13. private function Init():void {
  14. time= 0;
  15. addEventListener(Event.ENTER_FRAME, Draw);
  16. }
  17. private function Draw(event:Event):void {
  18. graphics.clear();
  19. graphics.beginFill(0x00FFFF);
  20. graphics.lineStyle(1, 0xFFFFFF);
  21. for (var i:int = 0; i < 30; i++) {
  22. graphics.drawCircle(50 + i * 10, 80 + Math.sin(i / 5 + time / 10) * 50, 3);
  23. }
  24. graphics.endFill();
  25. time++;
  26. }
  27. }
  28. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.