In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

Polygon Confusion

just a simple poly example to clear up confusion
Get Adobe Flash player
by shapevent 07 Mar 2010
/**
 * Copyright shapevent ( http://wonderfl.net/user/shapevent )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/iodS
 */

package {
    import flash.display.*;
    import com.actionsnippet.qbox.*;
    
    // just a simple poly example to clear up confusion
    
    public class FlashTest extends MovieClip {
        public function FlashTest() {
            // write as3 code here..
            
            /*
              
               0
              / \ 
             0_0 0
               | |
               0-0  
               
            */
            
            var sim:QuickBox2D = new QuickBox2D(this);
            sim.createStageWalls();
            
            sim.addBox({x:5, y:5, width:3, height:0.25,
                        density:0});
            
            // define the contour of your poly
            // no limits as long as it doesn't cross over
            // itself
            
            sim.addPoly({x:10, y:5, points:[0.5,0, 
                                            1, 1, 
                                            1, 2, 
                                            0.5, 2,
                                            0.5, 1,
                                            0,1],
                                            wireframe:false});
                                            
            sim.addCircle({x:11, y:10});
                                          
            
            sim.start();
            sim.mouseDrag();
        }
        
    }
}