forked from: forked from: Frocessing勉強中(ローディングのやつを作ってみる)

by hacker_tmbt9fl2 forked from forked from: Frocessing勉強中(ローディングのやつを作ってみる) (diff: 4)
FrocessingWork2
24色がクルクルする練習。
@author Copyright (C) naoto koshikawa, All Rights Reserved.
♥0 | Line 41 | Modified 2009-11-07 14:40:08 | MIT License
play

ActionScript3 source code

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

// forked from hacker_tmbt9fl2's forked from: Frocessing勉強中(ローディングのやつを作ってみる)
// forked from naoto5959's Frocessing勉強中(ローディングのやつを作ってみる)
package  
{
	import com.flashdynamix.utils.SWFProfiler;
	import frocessing.display.*;
	import frocessing.color.*;
	
	
	[SWF(width=465,height=465,backgroundColor=0x000000)]
	/**
	 * FrocessingWork2
	 * 24色がクルクルする練習。
	 * @author Copyright (C) naoto koshikawa, All Rights Reserved.
	 */
	public class FrocessingWork2 extends F5MovieClip2D
	{
		private var t:Number = 0;
		private var n:int = 24;
		private var radius:Number = 15;
		private	var eachWidth:Number = 6;
		private	var eachHeight:Number = 2;
		
		private var alphas:Array = [];
		
		public function FrocessingWork2() 
		{
			SWFProfiler.init(this);
			colorMode(HSV, n, 1, 1);
			noStroke();
			//stroke(1, 1, 1, 1);
			makeAlphas();
		}
		
		private function makeAlphas():void
		{
			for (var i:int = 0; i <= n; i++)
			{
				alphas.push(i/n + 0.1);
			}
		}
		
		
		public function draw():void
		{
			//
			translate( 465 / 2, 465 / 2 );
			for (var i:int  = 0; i <= n; i++)
			{
				rotate(-Math.PI * 2 / n);
				fill(0x00, 0x00, 0x99, alphas[(t+i) % n]);
				rect(radius, 0, eachWidth, eachHeight, 1, 1);
			}
			if (++t == 24) t = 0;
		}
	}
}