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

forked from: f5 color test 1

write as3 code here..
/**
 * Copyright onedayitwillmake ( http://wonderfl.net/user/onedayitwillmake )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/fdWd
 */

// forked from nutsu's f5 color test 1
// write as3 code here..
// write as3 code here..
package{
    import flash.display.*;
    import flash.events.*;
    
    import frocessing.FC;
    import frocessing.color.FColor;
    import frocessing.core.F5Graphics2D;

    [SWF(frameRate="60", width="465", height="465", backgroundColor="#000000")] 
    
    public class ColorWheel extends Sprite
    {
    	private var numBlocks:int = 0;
    	private var startColor:int = 0;
    	
        public function ColorWheel() 
        {
            addEventListener(Event.ENTER_FRAME,draw);
        }
        
        private function draw(e:Event):void
        {
        	startColor = (startColor + 2) % 360;
			var n:int;
			
			var c:FColor = new FColor();
            	c.hsv(startColor, 1, 1);
            	
            var fg:F5Graphics2D = new F5Graphics2D(graphics);
            	fg.noStroke();
				fg.rectMode(FC.CENTER); 
				fg.beginDraw();
				fg.translate( stage.stageWidth >> 1, stage.stageHeight >> 1);
				fg.rotate( -FC.HALF_PI );
           
           
            
            if(numBlocks < stage.stageWidth >> 1)	 
            	numBlocks++;
             
            n = numBlocks;
            for( var i:int=0; i<n / 3; i+=0.5 )
            {
                for(var j:int = 0; j< 3; j++)
                {
                    c.h -= 360/n;
                
                    fg.fillColor = c.value;
                    
                    //Start locationX, startLocationY, howhigh, how wide
                    fg.rect( (i+1) * 2, (i+1) * 2, 16, 28);
                    fg.rotate(FC.PI * 25/ n - 0.08); 
                }
            }
            
            fg.endDraw();
            
          
            
        }
    }
}