Set Shape position : graphics « Graphics « Flash / Flex / ActionScript






Set Shape position

 
package{
  import flash.display.*;
  
  public class Main extends Sprite{
    public function Main(){
        var rectangleB:Shape = new Shape();
        rectangleB.graphics.lineStyle(1, 0, 100, false, "none");
        rectangleB.graphics.lineTo(100, 0);
        rectangleB.graphics.lineTo(100, 50);
        rectangleB.graphics.lineTo(0, 50);
        rectangleB.graphics.lineTo(0, 0);
        rectangleB.y = 1;
        rectangleB.scaleX = 400;
        addChild(rectangleB);
    }
  }
}

        








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.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