160509_7
/**
* Copyright kazgo2 ( http://wonderfl.net/user/kazgo2 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/rSHV
*/
// forked from hacker_1ekeaszv's flash on 2010-3-22
package {
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class FlashTest extends Sprite {
public function FlashTest() {
// write as3 code here..
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:DrawCircle = new DrawCircle(e.stageX, e.stageY, nR, color);
addChild(oneCircle);
}
}
}
import flash.display.MovieClip;
class DrawCircle extends MovieClip
{
public function DrawCircle(centerX:int, centerY:int, r:int, color:int)
{
graphics.lineStyle(2, color);
graphics.drawCircle(centerX, centerY, r);
}
}