forked from: MouseEvent.CLICKの引数
/**
* Copyright mrhdms ( http://wonderfl.net/user/mrhdms )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/4IOG
*/
// forked from 9re's MouseEvent.CLICKの引数
package {
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.MouseEvent;
public class MouseClick extends Sprite {
public function MouseClick() {
// ステージがクリックされたときのイベント・リスナーを登録
stage.addEventListener(MouseEvent.CLICK, onClick);
}
// イベント・リスナー
private function onClick(e:MouseEvent):void {
var nR:int = Math.ceil(Math.random() * 20) + 10;
var color:int = Math.floor(Math.random() * 0xffffff);
var oneCircle:MovieClip = new DrawCircle1(e.stageX, e.stageY, nR, color);
addChild(oneCircle); }
}
}
import flash.display.MovieClip;
class DrawCircle1 extends MovieClip {
public function DrawCircle1(centerX:int, centerY:int, r:int, color:int){
graphics.lineStyle(2,color);
graphics.drawCircle(centerX,centerY,r);
}
}