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

[processing port] dotlassie's Carousel

Ported from dotlassie's 200-character Carousel
*
* Carousel by dotlassie, licensed under Creative Commons Attribution-Share Alike 3.0 license.
* Work: http://openprocessing.org/visuals/?visualID=4559
* License: http://creativecommons.org/licenses/by-sa/3.0/
*
Get Adobe Flash player
by forresto 08 Sep 2010
/**
 * Copyright forresto ( http://wonderfl.net/user/forresto )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/pvyH
 */

/*
 *
 * Ported from dotlassie's 200-character Carousel
 *
 * Carousel by dotlassie, licensed under Creative Commons Attribution-Share Alike 3.0 license.
 * Work: http://openprocessing.org/visuals/?visualID=4559
 * License: http://creativecommons.org/licenses/by-sa/3.0/
 *
 */

package 
{
    import flash.display.*;
    import flash.events.*;
        import frocessing.display.*;
    
    [SWF(frameRate="60", backgroundColor="#000000")] 
    public class SpinDraw extends F5MovieClip2D
    {
        
        private var _w:Number;
        private var _h:Number;

        public function SpinDraw() 
        {
            _w = stage.stageWidth;
            _h = stage.stageHeight;            
        }

                private var t:int = 0;
                private var i:int = 0;
                private var w:int = 255;
                private var a:Array = new Array(w*w);

        public function start():void
        {
                    t=i=0;
                    a = new Array(w*w);
                }
                        
        public function draw():void
        {
                    //if( isMousePressed )
                        //start();
                    
                    background(w);
                    smooth();
                    noFill();
                    beginShape();
                    a[t] = mouseY;
                    a[t+1] = mouseX-w;
                    for(i=0; i<t; i+=2)
                        vertex(w+cos((t-i)/w)*a[i+1],a[i]);
                    if(a[t]>0)
                        t+=2;
                    endShape();
        }
    }
}