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

PaintSample

see http://gihyo.jp/design/feature/01/frocessing/0003
Get Adobe Flash player
by nutsu 10 Aug 2009
/**
 * Copyright nutsu ( http://wonderfl.net/user/nutsu )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/x38h
 */

// see http://gihyo.jp/design/feature/01/frocessing/0003
package {
    import frocessing.display.F5MovieClip2DBmp;
    [SWF(width=465,height=465,backgroundColor=0x000000)]
    public class PaintSample extends F5MovieClip2DBmp
    {
        public function setup():void
        {
            //キャンバスのサイズ指定
            size( 465, 465 );
            //背景の描画
            background( 0 );
            //色指定
            stroke( 255, 0.5 );
        }
        
        public function draw():void
        {
            //マウスが押されているときは描画内容をクリア
            if ( isMousePressed )
                background( 0 );
            
            //直線の描画
            line( pmouseX, pmouseY, mouseX, mouseY );
        }
    }
}