package { import flash.display.Sprite; import flash.display.TriangleCulling; [SWF(width=550, height=400, backgroundColor=0xFFFFFF)] /** * Demonstrates simple use of drawing triangles using a sold fill. * Indices are used to define two triangles using four vertices. * Backface culling is used to reveal only triangles defined with vertices in a clockwise manner. */ public class graphic_flex_image_effects_01_Flex_DrawTrianglesCullingTest extends Sprite { /** * Constructor. Handles the drawing. */ public function graphic_flex_image_effects_01_Flex_DrawTrianglesCullingTest() { var vertices:Vector. = new Vector.(); vertices.push(100, 50); vertices.push(150, 100); vertices.push(50, 100); vertices.push(100, 150); var indices:Vector. = new Vector.(); indices.push(0, 1, 2); indices.push(1, 2, 3); graphics.beginFill(0xFF); graphics.drawTriangles(vertices, indices, null, TriangleCulling.POSITIVE); graphics.endFill(); } } }