グラデーション。

by pykgg476
♥0 | Line 23 | Modified 2009-08-18 00:47:07 | MIT License
play

ActionScript3 source code

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

package {
	import flash.display.GradientType;
	import flash.display.Sprite;
	import flash.geom.Matrix;

	public class GrandientFill extends Sprite
	{
		public function GrandientFill()
		{
			init();
		}
		
		private function init():void{
			graphics.lineStyle(1);
			var colors:Array = [0xfff98f,0xff1820];
			var alphas:Array = [1,1];
			var ratios:Array = [0,255];
			var matrix:Matrix = new Matrix();
			matrix.createGradientBox(100,100,87,100,100);
			graphics.beginGradientFill(GradientType.LINEAR,colors,alphas,ratios,matrix);
			graphics.drawRect(100,100,200,200);
			graphics.endFill();
		}
	}
}