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

mogero2

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

// 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();
            var i:Number;
            addChild(sp);
            sp.x = sp.y = 100;
            var g:Graphics = sp.graphics;
            g.lineStyle(0);
            g.drawCircle(0, 0, circle_r);
            var a:Number = line_r * Math.sqrt(2);
            var angle:Number = Math.atan2(line_r,circle_r);
            g.beginFill(0xFF8888);
            g.moveTo(a,0);
            g.lineTo(circle_r * Math.cos(Math.PI*0.25 - angle),circle_r * Math.sin(Math.PI*0.25 - angle));
            g.lineTo(circle_r * Math.cos(Math.PI*0.25 + angle),circle_r * Math.sin(Math.PI*0.25 + angle));
            g.lineTo(0,a);
            g.lineTo(circle_r * Math.cos(Math.PI*0.75 - angle),circle_r * Math.sin(Math.PI*0.75 - angle));
            g.lineTo(circle_r * Math.cos(Math.PI*0.75 + angle),circle_r * Math.sin(Math.PI*0.75 + angle));
            g.lineTo(-a,0);
            g.lineTo(circle_r * Math.cos(Math.PI*1.25 - angle),circle_r * Math.sin(Math.PI*1.25 - angle));
            g.lineTo(circle_r * Math.cos(Math.PI*1.25 + angle),circle_r * Math.sin(Math.PI*1.25 + angle));
            g.lineTo(0,-a);
            g.lineTo(circle_r * Math.cos(Math.PI*1.75 - angle),circle_r * Math.sin(Math.PI*1.75 - angle));
            g.lineTo(circle_r * Math.cos(Math.PI*1.75 + angle),circle_r * Math.sin(Math.PI*1.75 + angle));
            g.lineTo(a,0);
        }
    }
}