Introducing the Graphics Object
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
createSprite();
}
public function createSprite(){
var spr:Sprite = new Sprite();
spr.graphics.beginFill(0x00ff00, 1.0);
spr.graphics.drawRect(0, 0, 50, 50);
spr.graphics.endFill();
addChild(spr);
}
}
}
Related examples in the same category