I try to display a simple circle in the stage but it doesn’t work.
Here’s the code:
package {
import flash.display.Sprite;
import flash.display.Shape;
public class circles extends Sprite {
public function circles() {
var green:Shape = _createCircle(0x00FF00, 10);
green.x = 25;
green.y = 25;
addChild(green);
}
private function _createCircle(color: uint, radius: int):Shape {
var circle:Shape = new Shape();
circle.graphics.beginFill(color);
circle.graphics.drawCircle(0, 0, radius);
circle.graphics.endFill();
return circle;
}
}
}
What’s wrong with the code?