教材:角丸矩形に着色する (2)

by ProjectNya
♥0 | Line 24 | Modified 2010-05-28 21:16:33 | MIT License
play

ActionScript3 source code

/**
 * Copyright ProjectNya ( http://wonderfl.net/user/ProjectNya )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/kfrV
 */

package {
	import flash.display.Sprite;
	import flash.display.Shape;
	import flash.geom.ColorTransform;

	public class Main extends Sprite {
		private var shape:Shape;
		private static var color:uint = 0x00A8FF;

		public function Main() {
			init();
		}

		private function init():void {
			shape = new Shape();
			addChild(shape);
			shape.x = 232;
			shape.y = 232;
			shape.graphics.beginFill(0x000000);
			shape.graphics.drawRoundRect(-120, -90, 240, 180, 40, 40);
			shape.graphics.endFill();
			var colorTrans:ColorTransform = new ColorTransform();
			colorTrans.color = color;
			shape.transform.colorTransform = colorTrans;
		}

	}

}