Creates the triangle : Triangle « Graphics « Flash / Flex / ActionScript






Creates the triangle

 

package {
  import flash.display.GradientType;
  import flash.display.Sprite;
  import flash.geom.Matrix;
       
  public class Main extends Sprite {
  
       public function Main() {
          graphics.lineStyle(1);
          graphics.beginFill(0x00FF00, 1);
          graphics.moveTo(25, 0);
          graphics.lineTo(50, 25);
          graphics.lineTo(0, 25);
          graphics.lineTo(25, 0);
          graphics.endFill(  );
  
       }
  
  }
}

        








Related examples in the same category

1.Registers mouseMoveListener( ) to be executed whenever the mouse moves while the mouse pointer is over the Sprite object referenced by the variable triangle.
2.MouseEvent.MOUSE_MOVE: Handling MouseEvent.MOUSE_MOVE over a triangle
3.Draws a red triangle with a five pixel-thick black outline. Notice that the default start point (0, 0) matches the endpoint