package { import flash.display.Sprite; [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. */ public class graphic_flex_image_effects_01_Flex_DrawTrianglesIndicesTest extends Sprite { /** * Constructor. Handles the drawing. */ public function graphic_flex_image_effects_01_Flex_DrawTrianglesIndicesTest() { 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); graphics.endFill(); } } }