I’m having some problems with a little script I’m working on that will create circles in a movieclip so that I can position them later. The problem is that the circle doesn’t seem to be drawing within the clip. I trace it’s x,y,width and height and it’s all 0…
Here’s what I have so far.
function drawCircle(centerX, centerY, radius, sides, clpNm, clr){
this.createEmptyMovieClip([clpNm],this.getNextHighestDepth());
[clpNm]moveTo(centerX + radius, centerY);
[clpNm]lineStyle(0);
[clpNm]beginFill(clr,100);
for(var i=0; i<=sides; i++){
var pointRatio = i/sides;
var pointX = centerX + Math.cos(pointRatio*2*Math.PI) * radius;
var pointY = centerY + Math.sin(pointRatio*2*Math.PI) * radius;
[clpNm]lineTo(pointX, pointY);
}
[clpNm]endFill();
trace(w._width);
twitch(clpNm);
}
drawCircle(25, 25, 25, 150,"w",0x333333);
The problem is almost definitely with the naming of the clip I think, but I can’t figure it so. Any help would be great.