Draw a Triangle


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.