package{ import flash.display.Sprite; public class Test extends Sprite { private var ball:Ball; public function Test() { ball = new Ball(); ball.x = stage.stageWidth/2 ball.y = stage.stageHeight/2 this.addChild(ball); } } } import flash.display.Sprite; class Ball extends Sprite { private var hankei:Number; private var iro:uint; public function Ball(hanikei:Number = 10, iro:uint = 0x666666) { this.hankei = hanikei; this.iro = iro; init(); } private function init():void { graphics.beginFill(iro); graphics.drawCircle(0, 0, hankei); graphics.endFill(); } } ボール