Drawing Lines in a 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 
Drawing Lines in a Graphics Object
 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
      var spr:Sprite = new Sprite();
      spr.graphics.lineStyle(10x0000ff);
      spr.graphics.moveTo(3030);
      spr.graphics.lineTo(10030);
    
      spr.graphics.lineTo(100100);
      spr.graphics.lineTo(30100);
      spr.graphics.lineTo(3030);
      spr.graphics.endFill();
    
      addChild(spr);

    }
  }
}

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