/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
package { import flash.display.Sprite; import flash.events.Event; [SWF(width="400", height="200", backgroundColor="0x000000", frameRate="30")] public class FlashTest extends Sprite { private var time:int = 0; public function FlashTest() { // write as3 code here.. Init(); } private function Init():void { time= 0; addEventListener(Event.ENTER_FRAME, Draw); } private function Draw(event:Event):void { graphics.clear(); graphics.beginFill(0x00FFFF); graphics.lineStyle(1, 0xFFFFFF); for (var i:int = 0; i < 30; i++) { graphics.drawCircle(50 + i * 10, 80 + Math.sin(i / 5 + time / 10) * 50, 3); } graphics.endFill(); time++; } } }