Posted By

sidneydekoning on 05/14/09


Tagged


Versions (?)

Draw a Triangle


 / Published in: ActionScript 3
 

  1. var triangleHeight:uint = 100;
  2. var triangleShape:Shape = new Shape();
  3.  
  4. triangleShape.graphics.lineStyle(1,0xff00ff00)
  5. triangleShape.graphics.beginFill(0xff0000);
  6. triangleShape.graphics.moveTo(triangleHeight/2, 5);
  7. triangleShape.graphics.lineTo(triangleHeight, triangleHeight+5);
  8. triangleShape.graphics.lineTo(0, triangleHeight+5);
  9. triangleShape.graphics.lineTo(triangleHeight/2, 5);
  10. addChild(triangleShape);

Report this snippet  

You need to login to post a comment.