drawCircel()方法可以用指定的半径绘制标准圆形,圆心由参数中的x,y坐标位置指定
drawEllipse()方法按照指定的宽度和高度绘制一个椭圆形,椭圆形的左上角由参数中的x,y坐标指定
drawRect()方法指定的宽度和高度绘制一个矩形,矩形的左上角由参数中的x和y坐标位置指定
drawRoundRect()方法指定的宽度和高度绘制一个圆角矩形,矩形的左上角由参数中的x和y坐标位置指定,矩形的四个角半径是指定的ellipseWidth和ellipseHeight
package { import flash.display.Sprite; public class as5 extends Sprite { public function as5() { draw(); } private function draw():void { var halfWidth:Number = stage.stageWidth/2; var halfHeight:Number = stage.stageHeight/2; var quarterWidth:Number = halfWidth/2; var quarterHeight:Number = halfHeight/2; graphics.beginFill(0xFF0000); graphics.drawCircle(quarterWidth,quarterHeight,Math.min(quarterWidth,quarterHeight)); graphics.endFill(); graphics.beginFill(0x0000FF); graphics.drawEllipse(halfWidth,0,halfWidth,halfHeight); graphics.endFill(); graphics.beginFill(0x00FF00); graphics.drawRect(0,halfHeight,halfWidth,halfHeight); graphics.endFill(); graphics.beginFill(0xFF00FF); graphics.drawRoundRect(halfWidth,halfHeight,halfWidth,halfHeight,70,70); graphics.endFill(); } } }