お絵描き
/**
* Copyright d4_1977 ( http://wonderfl.net/user/d4_1977 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/di9d
*/
package {
import flash.display.Sprite;
import flash.events.*;
import flash.text.*;
public class DrawTest extends Sprite{
public var canvas:Sprite = new Sprite();
public function DrawTest(){
canvas.graphics.beginFill(0xe7e7e7);
canvas.graphics.drawRect(10,10,300,300);
canvas.graphics.endFill();
addChild(canvas);
canvas.addEventListener(MouseEvent.MOUSE_MOVE, drawHandler)
}
public function drawHandler(events:MouseEvent):void{
canvas.graphics.lineStyle(1, 0xcc0000);
canvas.graphics.lineTo(events.stageX,events.stageY);
var tf:TextField = new TextField();
tf.text = events.stageX + ' : ' + events.stageY;
}
}
}