flash on 2013-1-16

by hemingway
♥0 | Line 42 | Modified 2013-01-16 05:20:38 | MIT License
play

ActionScript3 source code

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

package
{
    import Box2D.Common.Math.*;
    import flash.display.*; 
    import flash.events.*;
    import flash.geom.*;
    
    public class Main extends Sprite
    {
        public function Main()
        {
            addEventListener(Event.ADDED_TO_STAGE, addedToStage);
        }
        
        public function _init() :void
        {
            graphics.clear();
            graphics.lineStyle(1, 0, 0.75);
            graphics.drawRect(0, 0, 464, 464);
        }

        public function addedToStage($e:Event) :void
        {
            removeEventListener(Event.ADDED_TO_STAGE, addedToStage);
            
            Buffer.buildContext(this);    
            
            _init();
        }
    }
}

import Box2D.Common.*;
import Box2D.Collision.*;
import Box2D.Dynamics.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;

class Buffer
{
    public static var context :Object;
    public static var content :Array;
    
    //declare box2d?
    
    public static function buildContext($context:Object) :void
    {
        context = $context;
        content = [];
    }
}