flash on 2012-11-17

by hemingway
♥0 | Line 33 | Modified 2012-11-17 03:11:34 | 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/88lr
 */

package
{
    import flash.display3D.*;
    import flash.display.*;
    import flash.events.*;
    import flash.geom.*;
    
    [SWF(frameRate = 60, width = 460, height = 345)]
    public class Main extends Sprite
    {
        private const renderAreaWidth  :Number = 460;
        private const renderAreaHeight :Number = 345;
        
        private var _stage3D :Stage3D;
        private var _context3D :Context3D;
        
        public function Main()
        {
            stage.scaleMode = StageScaleMode.NO_SCALE;
            
            if (stage) {_init()}
            else       {addEventListener(Event.ADDED_TO_STAGE, _init)}
           
            _stage3D = stage.stage3Ds[0];
            _stage3D.addEventListener(Event.CONTEXT3D_CREATE, contextLoaded);
            _stage3D.requestContext3D();
        }
        
        public function _init() :void
        {
            graphics.clear     ();
            graphics.lineStyle (1, 0, 0.75);
            graphics.drawRect  (0, 0, 459, 344);
        }
        
        public function contextLoaded($e:Event) :void
        {
            
        }
    }
}