package { import flash.display.*; import flash.text.TextField; public class HelloWorld extends Sprite { public function HelloWorld() { //create our rect and circle shape var rectAndCircle:Shape = new Shape(); //set line thickness to one pixel rectAndCircle.graphics.lineStyle(1); //draw a blue rectangle rectAndCircle.graphics.beginFill(0x0000FF,1); rectAndCircle.graphics.drawRect(125,0,150,75); //draw a red circle rectAndCircle.graphics.beginFill(0xFF0000,1); rectAndCircle.graphics.drawCircle(50,100,50); //display it! addChild(rectAndCircle); //create a textfield object to contain some text var greeting_txt:TextField = new TextField(); //specify the text to display greeting_txt.text = "Hello World"; //position the TextField object greeting_txt.x = 200; greeting_txt.y = 300; //display the text on screen by adding greeting_txt to the display list addChild(greeting_txt); } } }