In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

Simple line doodle

Get Adobe Flash player
by spikything 31 Mar 2009
package {

    import flash.display.Sprite;
    import flash.events.Event;
    
    public class FlashTest extends Sprite {
    private var ticker:Number = 0;
    private var step:Number = .1;
    private var s:Number = 100;
    private var lineColour:Number = 0xff0000;
    private var lineAlpha:Number = .2;
    private var c:Sprite;
        
        public function FlashTest() {
            c = new Sprite();
            c.cacheAsBitmap = true;
            c.x = c.y = 150;
            addChild(c);
            addEventListener(Event.ENTER_FRAME, update);
        }
        
        private function update (e:Event):void {
            ticker += step;
            var phase:Number = ticker / Math.PI;
            var st:Number = Math.sin(ticker);
            var ct:Number = Math.cos(ticker);
            var sp:Number = Math.sin(phase);
            c.graphics.lineStyle(0, lineColour, lineAlpha);
            c.graphics.curveTo(ct*s*sp*2, st*s/2, st*s, ct*s);
        }
        
    }
}