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

全然回答になってないけど

Graphics.drawCircle と drawRoundRect が壊れました。
別の方法で、半径 CIRCLE_RADIUS の 円を書きなさい。
@mxmlc -o bin/CircleTest.swf -load-config+=obj\Alltest3Config.xml
@author jc at bk-zen.com
Get Adobe Flash player
by keno42 04 Dec 2009
    Embed
/**
 * Copyright keno42 ( http://wonderfl.net/user/keno42 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/h55a
 */

// forked from bkzen's 【問題】Graphics の drawCircle と drawRoundRect が壊れました
package 
{
	import flash.display.Graphics;
	import flash.display.Sprite;
	import flash.events.Event;
	
	/**
	 * Graphics.drawCircle と drawRoundRect が壊れました。
	 * 別の方法で、半径 CIRCLE_RADIUS の 円を書きなさい。
	 * @mxmlc -o bin/CircleTest.swf -load-config+=obj\Alltest3Config.xml
	 * @author jc at bk-zen.com
	 */
	public class CircleTest extends Sprite
	{
		private const ANSWER_COLOR: uint = 0x003366;
		private const COLOR: uint = 0x3399CC;
		private const CIRCLE_RADIUS: Number = 50;
		
		public function CircleTest() 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e: Event = null): void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			//
			var centerX: Number = (stage.stageWidth - CIRCLE_RADIUS) / 2;
			var centerY: Number = (stage.stageHeight - CIRCLE_RADIUS) / 2;
			var g: Graphics = graphics;
			// 差を見るために解答として先に半径+1 の円を描いておきます。
//			g.beginFill(ANSWER_COLOR); g.drawCircle(centerX, centerY, CIRCLE_RADIUS + 1);
			
			// 
                        addEventListener(Event.ENTER_FRAME,onEnterFrame);
                }
                private var count:int = 0;
                private function onEnterFrame(e:Event):void{
			var centerX: Number = (stage.stageWidth - CIRCLE_RADIUS) / 2;
			var centerY: Number = (stage.stageHeight - CIRCLE_RADIUS) / 2;
			var g: Graphics = graphics;
                        g.clear();
			drawCircle(g, centerX, centerY, CIRCLE_RADIUS, COLOR);
		}
		
		/**
		 * これを作る。
		 * @param	g
		 * @param	x
		 * @param	y
		 * @param	r
		 * @param	color
		 */
		public function drawCircle(g: Graphics, x: Number, y: Number, r: Number, color: uint): void
		{
                        g.endFill();
                        g.lineStyle(0, color & 0xFFFFFF);
                        var a:Number = 5 + 4 * Math.sin(count++*0.1);
                        var limit:Number = 2 * Math.PI;
                        var step:Number = limit / 100;
                        r *= a;
                        var j:Number = 2 * Math.atan2(Math.sqrt(a*a-1),1);
			for( var i:Number = 0; i < limit; i+=step ){
                            g.moveTo(x + r * Math.cos(i), x + r * Math.sin(i));
                            g.lineTo(x + r * Math.cos(j), x + r * Math.sin(j));
                            j+=step;
                        }
		}
		
	}

}