Introducing the Graphics Object : graphics « 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 » graphics 




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(0x00ff001.0);
      spr.graphics.drawRect(005050);
      spr.graphics.endFill();
      addChild(spr);
    }
  }
}

        














Related examples in the same category
1.Creating Fills
2.Drawing Circles
3.Drawing Rounded Rectangles
4.Draw lines
5.Use the graphics
6.Change line style
7.Change scaleX
8.Set Shape position
9.Draw three shapes
10.Draw four shapes
11.Moving the Pen without Drawing
12.Drawing a Straight Line
13.Drawing a Curve
14.Adding a Simple One-Color Fill
15.To move the drawing pen without drawing any line at all, use moveTo( ).
16.To remove all vector drawings in an object, we use the Graphics class's instance method clear( ).
17.Drawing Lines in a Graphics Object
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.