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

forked from: mogero2

Get Adobe Flash player
by bkzen 01 Jul 2010
/**
 * Copyright bkzen ( http://wonderfl.net/user/bkzen )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/j0aj
 */

// forked from keno42's mogero2
// forked from keno42's mogero
package {
    import flash.display.Sprite;
     import flash.display.Graphics;
    public class FlashTest extends Sprite {
        private var line_r:Number = 10;
        private var circle_r:Number = 50;
        private var step:Number = Math.PI / 16;
        public function FlashTest() {
            // write as3 code here..
            var sp:Sprite = new Sprite();
            addChild(sp);
            sp.x = sp.y = 100;
            var g:Graphics = sp.graphics;
            g.lineStyle(0);
            g.drawCircle(0, 0, circle_r);
            createX(sp.graphics, 0xFF8888, circle_r);
        }
        
        private function createX(g:Graphics, color: uint, r: Number):void
        {
            g.beginFill(color);
            var l: Number = r / 4;
            var a: Number = l * Math.sqrt(2);
            var angle: Number = Math.atan2(l, r);
            g.moveTo(a, 0);
            for (var i:int = 0; i < 4; i++) 
            {
                var rad: Number = Math.PI * (0.25 + i * 0.50);
                g.lineTo(r * Math.cos(rad - angle), r * Math.sin(rad - angle));
                g.lineTo(r * Math.cos(rad + angle), r * Math.sin(rad + angle));
                rad = Math.PI * (i + 1) * 0.50;
                g.lineTo(a * Math.cos(rad), a * Math.sin(rad));
            }
        }
    }
}