Create Rectangle and Circle : Circle « Graphics « Flash / Flex / ActionScript






Create Rectangle and Circle

 
package {
  import flash.display.*;
  import flash.text.TextField;

  public class GreetingApp extends Sprite {
    public function GreetingApp(  ) {
      var rectAndCircle:Shape = new Shape(  );

      rectAndCircle.graphics.lineStyle(1);

      rectAndCircle.graphics.beginFill(0x0000FF, 1);
      rectAndCircle.graphics.drawRect(125, 0, 150, 75);

      rectAndCircle.graphics.beginFill(0xFF0000, 1);
      rectAndCircle.graphics.drawCircle(50, 100, 50);

      rectAndCircle.x = 125;
      rectAndCircle.y = 100;

      addChild(rectAndCircle);

      var greeting_txt:TextField = new TextField(  );

      greeting_txt.text = "Hello world";

      greeting_txt.x = 200;
      greeting_txt.y = 300;

      addChild(greeting_txt);
    }
  }
}

        








Related examples in the same category

1.Create a circle shape
2.Fill a circle
3.Creating Custom Visual Classes
4.Circle Clicker