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

flash on 2009-11-17

Get Adobe Flash player
by AceDecade 17 Nov 2009
    Embed
package {
    import flash.display.*;
    import flash.events.*;
    public class FlashTest extends MovieClip {
        public var VA:Array;
        public function FlashTest() {
            VA = new Array();
            addVector(20,20,10,0,200);
            addVector(20,20,5,Math.PI/2,80);
            addVector(40,20,5,Math.PI/2,80,2);
            addVector(60,20,5,Math.PI/2,80,4);
            addVector(80,20,5,Math.PI/2,80,6);
            addVector(100,20,5,Math.PI/2,80,8);
            addVector(120,20,5,Math.PI/2,80,10);
            addVector(140,20,5,Math.PI/2,80,12);
            addVector(160,20,5,Math.PI/2,80,14);
            addVector(180,20,5,Math.PI/2,80,16);
            addVector(200,20,5,Math.PI/2,80,18);
            addVector(220,20,5,Math.PI/2,80,20);
            addVector(20,100,5,0,400,16);
            addVector(240,100,5,Math.PI/2,20,60);
            addVector(260,100,5,Math.PI/2,40,64);
            addVector(280,100,5,Math.PI/2,60,68);
            addVector(300,100,5,Math.PI/2,80,72);
            addVector(320,100,5,Math.PI/2,100,76);
            addVector(340,100,5,Math.PI/2,120,80);
            addVector(360,100,5,Math.PI/2,140,84);
            addVector(380,100,5,Math.PI/2,160,88);
            addVector(400,100,5,Math.PI/2,180,92);
            addVector(420,100,5,Math.PI/2,200,96);
            stage.addEventListener(Event.ENTER_FRAME,main);
        }
        public function main(e:Event):void{
            for(var i:int=0;i<VA.length;i++){
                var v:MovieClip = VA[i];
                if (v.delay > 0){
                    v.delay -= 1;
                }else{
                    v.ox += v.vx;
                    v.oy += v.vy;
                    v.graphics.lineTo(v.ox,v.oy);
                    v.timer -= 1;
                    if(v.timer == 0){
                        VA.splice(i,1);
                        i -= 1;
                    }
                }
            }
        }
        public function addVector(X:Number,Y:Number,V:Number,A:Number,D:Number,delay:Number=0):void{
            var v:MovieClip = new MovieClip();
            addChild(v);
            VA.push(v);
            v.x = X;
            v.y = Y;
            v.vx = Math.cos(A)*V;
            v.vy = Math.sin(A)*V;
            v.ox = 0;
            v.oy = 0;
            v.timer = D/V;
            v.delay = delay;
            v.graphics.lineStyle(1,0x000000,1);
        }
    }
}