trangles

by ifree
♥0 | Line 24 | Modified 2012-12-15 04:43:39 | MIT License
play

ActionScript3 source code

/**
 * Copyright ifree ( http://wonderfl.net/user/ifree )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/xPEJ
 */

package {
    import flash.media.Video;
    import flash.display.Sprite;
    
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            init();
            this.graphics.beginFill(0xff00f0);
            this.graphics.drawTriangles(mVertices,mIndices,null,'positive');
            this.graphics.endFill();
        }
        
        private var mVertices:Vector.<Number>;
        private var mIndices:Vector.<int>;
        
        private function init():void{
            mVertices=new Vector.<Number>;
            mIndices=new Vector.<int>;
            mVertices.push(200,100);
            mVertices.push(100,100);
            mVertices.push(150,150);
            mVertices.push(150,50);
            mIndices.push(0,1,2);
            mIndices.push(3,1,2);;
        }
                
    }
}