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 2011-4-27

Get Adobe Flash player
by sagpipes 26 Apr 2011
    Embed
package {
    import flash.display.Sprite;
    // write as3 code here..
            import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.events.MouseEvent;

    public class FlashTest extends Sprite {
        public function FlashTest() {
            

var circles:Array = new Array();
for(var i:uint = 0; i < 15; i++) {
    var circle:Sprite = new Sprite;
    // create a fill of random color and random alpha transparency
    circle.graphics.beginFill(Math.random()*0xFFFFFF, Math.random());
    circle.graphics.drawCircle(0,0,10);
    circle.graphics.endFill();
    addChild(circle);
    // add each circle to an array for reference later in the tweenCircles function
    circles.push(circle);
}

stage.frameRate = 31;
stage.addEventListener(MouseEvent.CLICK,tweenCircles);

function tweenCircles(e:MouseEvent):void {
    // get each circle
    for each(var circle:Sprite in circles) {
        // tween this circle from its current position towards the mouse event position, adding some random variance
        var xTween:Tween = new Tween(circle, "x", Strong.easeOut, circle.x, e.stageX + (Math.random()*100)-50, 1, true);
        var yTween:Tween = new Tween(circle, "y", Strong.easeOut, circle.y, e.stageY + (Math.random()*100)-50, 1, true);
    }
}
        }
    }
}