Hi All,
I need to get a random xy value from a circle, for example going to spread circles on stage randomly. Its quiet easy to spread the circle in a square.
Here that was done…
var MC:MovieClip=new MovieClip();
var squareWidth:Number=200;
var squareHeight:Number=200;
for (var i:int=0; i<=100; i++) {
MC=drawCircle();
MC.id=i;
MC.x=Math.random()*squareWidth;
MC.y=Math.random()*squareHeight;
addChild(MC);
}
function drawCircle() {
var circle:MovieClip=new MovieClip();
circle.graphics.beginFill(0xFF6600);
circle.graphics.drawCircle(0,0,10);
return (circle);
}
Can anyone modify this code and spread those circle within a circle ?