Mega Code Archive

 
Categories / Flash ActionScript / Graphics
 

Drawing a Straight Line

package{   import flash.display.*;      public class Main extends Sprite{     public function Main(){         var shape:Shape = new Shape ();         shape.graphics.lineStyle(0, 0xFF0000);         shape.graphics.lineTo(100, 0);         shape.graphics.lineTo(100, 100);         shape.graphics.lineStyle(0, 0xFF0000);         shape.graphics.moveTo(100, 100);         shape.graphics.lineTo(150, 100);         shape.graphics.moveTo(200, 100);         shape.graphics.lineTo(250, 100);         shape.graphics.moveTo(125, 200);         shape.graphics.lineTo(225, 200);         addChild(shape);     }   } }