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 2013-3-20

Get Adobe Flash player
by diverdm 20 Mar 2013
    Embed
/**
 * Copyright diverdm ( http://wonderfl.net/user/diverdm )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/oqxy
 */

package {
    import flash.events.Event;
    import flash.display.MovieClip;
    import flash.display.Sprite;
    public class FlashTest extends Sprite 
    {
        public function FlashTest() 
        {
            for (var i:int = 0; i < 20; i++)
            for (var g:int = 0; g < 20; g++)
            {
                var mc:MovieClip = new MovieClip();
                mc.graphics.lineStyle(1, 0);
                mc.graphics.beginFill(0xff7700);
                mc.graphics.moveTo(-10, -10);
                mc.graphics.lineTo(10, -10);
                mc.graphics.lineTo(10, 10);
                mc.graphics.lineTo(-10, 10);
                mc.graphics.lineTo(-10, -10);
            
                mc.x = 40 + i * 20;
                mc.y = 40 + g * 20;
                mc.sx = mc.x;
                mc.sy = mc.y;
                mc.periodX = g / 5;
                mc.periodY = i / 5;
                mc.addEventListener(Event.ENTER_FRAME, _enterframeHandler);
                addChild(mc);
            }
            
            function _enterframeHandler(e:Event):void
            {
                e.target.x = e.target.sx+Math.sin(e.target.periodX) * 20;
                e.target.y = e.target.sy+Math.sin(e.target.periodY) * 20;
                e.target.periodX += 0.1;
                e.target.periodY += 0.1;
                e.target.rotation++;
            }
        }
    }
}