forked from: flash on 2010-3-3

by yotsu42keisuke forked from flash on 2010-3-3 (diff: 55)
Frocessingテスト
@author ish-xxxx
♥0 | Line 40 | Modified 2010-11-06 01:05:24 | MIT License
play

ActionScript3 source code

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

// forked from ish_xxxx's flash on 2010-3-3
package 
{
    import flash.display.MovieClip;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.geom.Point;
    import frocessing.display.F5MovieClip2D;
    
    /**
     * Frocessingテスト
     * @author ish-xxxx
     */
    [SWF(frameRate="60",backgroundColor="#121212")]
    public class Index extends F5MovieClip2D
    {
        ////////////////////////////////////
        // Variables
        ////////////////////////////////////
        protected var count:Number = 0;
        protected var points:Vector.<Point> = new Vector.<Point>;
        
        //Constructor
        public function Index() 
        {
            //super();
        }
        
        //セットアップ
        public function setup(): void
        {
            colorMode( HSV, 10 );
            noSmooth();
            noFill();
        }
        
        //描画
        public function draw(): void
        {
            stroke( 0xffffff, 100, 100, 100 );
            points.push( new Point( mouseX, mouseY ) );
            var l:int = points.length;
            beginShape();
                for ( var i:uint = 0; i < l; i++ ) {
                    circle( points[i].x, points[i].y, Math.random()*100 );
                }
                for ( i = 0; i < l; i++ ) {
                    curveVertex( points[i].x, points[i].y );
                }
                endShape();
            if ( points.length > 100 ) {
                points.shift();
            }
            //count += 0.25;
        }
        
    }

}