#12002/8/8 23:52:27
//******************画圆函数***************
//参数
//r 半径
//x,y 圆心坐标
//thickness 线条宽度
//rgb 线条颜色
//alpha 线条透明度
//******************************************
MovieClip.prototype.drawCircle = function(r,x,y,thickness,rgb,alpha) {
if (x==undefined) {
x = 0;
}
if (y==undefined) {
y = 0;
}
if (thickness==undefined) {
thickness = 1;
}
if (rgb==undefined) {
rgb = 0;
}
if (alpha==undefined) {
alpha = 100;
}
var cy = r*Math.SQRT2-r;
var a = r/Math.SQRT2;
this.lineStyle(thickness,rgb,alpha);
this.moveTo((r+x),y);
this.curveTo((r+x),(cy+y),(a+x),(a+y));
this.curveTo((cy+x),(r+y),x,(r+y));
this.curveTo((x-cy),(r+y),(x-a),(a+y));
this.curveTo(x-r,(cy+y),(x-r),y);
this.curveTo((x-r),(y-cy),(x-a),(y-a));
this.curveTo((x-cy),(y-r),x,(y-r));
this.curveTo((cy+x),(y-r),(a+x),(y-a));
this.curveTo((r+x),(y-cy),(r+x),y);
};
//****************画填充圆函数*****************
MovieClip.prototype.drawCircleF = function(r,x,y,rgb,alpha) {
if (rgb==undefined) {
rgb = 0;
}
this.beginFill(rgb);
this.drawCircle(r,x,y,1,rgb,alpha);
this.endFill();
};
// ***************画矩形函数*******************
// 参数
// x1,y1 起始点坐标
// x2,y2 终点坐标
// thickness 线条宽度
// rgb 线条颜色
// alpha 线条透明度
// ******************************************
MovieClip.prototype.drawBox = function(x1, y1, x2, y2, thiceness, rgb, alpha) {
if (x1 == undefined) {
x1 = 0;
}
if (y1 == undefined) {
y1 = 0;
}
if (thickness == undefined) {
thickness = 1;
}
if (rgb == undefined) {
rgb = 0;
}
if (alpha == undefined) {
alpha = 100;
}
this.lineStyle(thickness, rgb, alpha);
this.moveTo(x1, y1);
this.lineTo(x2, y1);
this.lineTo(x2, y2);
this.lineTo(x1, y2);
this.lineTo(x1, y1);
};
//************画填充矩形函数*******************
MovieClip.prototype.drawBoxF = function(x1, y1, x2, y2,rgb, alpha) {
if (rgb==undefined) {
rgb = 0;
}
this.beginFill(rgb);
this.drawBox(x1,y1,x2,y2,1,rgb,alpha);
this.endFill();
};