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

任意の点を通る曲線

Get Adobe Flash player
by esukei 13 Mar 2009
/**
 * Copyright esukei ( http://wonderfl.net/user/esukei )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/ntP7
 */

package {
    import flash.display.Sprite;
    import flash.events.Event;
    
    [SWF(frameRate=60)]
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            stage.addChild(this);
            
            addEventListener(Event.ENTER_FRAME, function(event:Event):void{
            graphics.clear();
            graphics.lineStyle(1,0xFF0000);
            
            graphics.moveTo(0,0);
            
            var controlX:Number = mouseX * 2 - (0 + stage.stageWidth) / 2;
            var controlY:Number = mouseY * 2 - (0 + stage.stageHeight) / 2;
            
            graphics.curveTo(controlX,controlY,stage.stageWidth,stage.stageHeight);
            
            });
        }
    }
}