To move the drawing pen without drawing any line at all, use moveTo( ). : graphics « Graphics « Flash / Flex / ActionScript






To move the drawing pen without drawing any line at all, use moveTo( ).

 
package{
  import flash.display.*;
  
  public class Main extends Sprite{
    public function Main(){

        var canvas:Shape = new Shape(  );   // Create the Shape to draw in
        canvas.graphics.lineStyle(1);     // Set the stroke to 1 point, black
        canvas.graphics.moveTo(100, 100); // Move the pen without drawing a line
        canvas.graphics.lineTo(200, 200); // Draw the line (this also moves the pen)
        addChild(canvas);

    }
  }
}

        








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 remove all vector drawings in an object, we use the Graphics class's instance method clear( ).
17.Drawing Lines in a Graphics Object