Posted By

arpo on 12/19/08


Tagged


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

jpdevries
THEPWN3R
psychoinca
useallfive


Draw triangle


 / Published in: ActionScript 3
 

Basic code to draw a triangle.

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

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: vmcampos on July 18, 2011

Exactly what I was looking for on behalf of my students. Simple and works great! Thank you.

Posted By: vmcampos on July 18, 2011

Exactly what I was looking for on behalf of my students. Simple and works great! Thank you.

You need to login to post a comment.