A function for drawing stars:
function drawStar(mc:MovieClip, p:Number, er:Number, ir:Number, x:Number, y:Number, ps:Number):Void {
if(ps == undefined) {
if(p % 2) {
ps = -Math.PI / 2;
} else if((p - 6) % 4 == 0) {
ps = 0;
} else {
ps = Math.PI / p;
}
}
var i:Number = 2 * Math.PI / p;
var j:Number = i / 2;
var ts:Number;
for(var t:Number = 0; t < 2 * Math.PI; t += i) {
ts = t - ps;
mc[t ? "lineTo" : "moveTo"](x + Math.cos(ts) * er, y + Math.sin(ts) * er);
mc.lineTo(x + Math.cos(ts + j) * ir, y + Math.sin(ts + j) * ir);
}
mc.lineTo(x + Math.cos(ps) * er, y + Math.sin(-ps) * er)
}
//drawStar(mc:MovieClip, p:Number, er:Number, ir:Number, x:Number, y:Number, [ps:Number]):Void
//mc - The movie clip in which to draw the star
//p - The number of points on the star
//er - The radius of the external circumscribed circle
//ir - The radius if the internal circumscribed circle
//x - The x centre of the circumscribed circle
//y - the y centre of the circumscribed circle
//ps - The phase shift or angular offset of the polygons' vertices (ie the rotation)