Create a circle shape : Circle « Graphics « Flash / Flex / ActionScript

Home
Flash / Flex / ActionScript
1.Animation
2.Array
3.Class
4.Data Type
5.Development
6.Function
7.Graphics
8.Language
9.Network
10.Regular Expressions
11.Statement
12.String
13.TextField
14.XML
Flash / Flex / ActionScript » Graphics » Circle 
Create a circle shape
 

package {
  import flash.display.*;
  public class DisplayListExample extends Sprite {
    public function DisplayListExample(  ) {
      var red:Shape = createCircle0xFF000010 );
      red.x = 10;
      red.y = 20;
      var green:Shape = createCircle0x00FF0010 );
      green.x = 15;
      green.y = 25;
      var blue:Shape = createCircle0x0000FF10 );
      blue.x = 20;
      blue.y = 20;
      
      var container1:Sprite = new Sprite(  );
      container1.addChildred );
      container1.addChildgreen );
      container1.addChildblue );
      
      addChildcontainer1 );
      
      var container2:Sprite = new Sprite(  );
      addChildcontainer2 );
      
      container2.addChildred );
    }
    
    public function createCirclecolor:uint, radius:Number ):Shape {
      var shape:Shape = new Shape(  );
      shape.graphics.beginFillcolor );
      shape.graphics.drawCircle00, radius );
      shape.graphics.endFill(  );
      return shape;
    }
  }
}

        
Related examples in the same category
1.Create Rectangle and Circle
2.Fill a circle
3.Creating Custom Visual Classes
4.Circle Clicker
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.