Draw a circle using graphics Class


package
{
 import flash.display.Graphics;
 import flash.display.Sprite;
 import flash.events.Event;
 
 /**
  * …
  * @author Jeet Chauhan
  */
 public class Main extends Sprite
 {
  public function Main():void
  {
   if (stage) init();
   else addEventListener(Event.ADDED_TO_STAGE, init);
  }
  
  private function init(e:Event = null):void
  {
   removeEventListener(Event.ADDED_TO_STAGE, init);
   // entry point
   code();
  }
  
  private function code():void
  {
   var g:Graphics = graphics;
   g.beginFill(0xff0000, 1)
   g.drawCircle(10, 10, 5);
   g.endFill();
  }
  
 }
 
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s