Actionscript:
-
stage.frameRate = 30;
-
var xp:Number = 0;
-
var yp:Number = 0;
-
var counter:Number = 0;
-
graphics.lineStyle(0,0x999999);
-
graphics.moveTo(200,200);
-
addEventListener(Event.ENTER_FRAME, onLoop);
-
function onLoop(evt:Event):void {
-
for (var i:int = 0; i <20; i++) {
-
counter += .05;
-
xp=200 + counter * Math.cos(counter);
-
yp=200 + counter * Math.sin(counter);
-
graphics.lineTo(xp, yp);
-
}
-
if (counter> 400) {
-
removeEventListener(Event.ENTER_FRAME, onLoop);
-
}
-
}
Draws a spiral over time.