forked from: flash player 11.2

by bradsedito forked from flash player 11.2 (diff: 1)
♥0 | Line 31 | Modified 2012-08-31 01:35:31 | MIT License
play

ActionScript3 source code

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

// forked from wh0's flash player 11.2
package {
    import flash.display.*;
    import flash.display3D.*;
    import flash.events.*;
    import flash.system.*;
    
    import com.actionscriptbible.Example;
    public class FlashTest extends Example {
        
        public function FlashTest() {
            loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, function (e:UncaughtErrorEvent):void { trace(e.error); } );
        
            trace('swf verson: ' + loaderInfo.bytes[3] + ' (fp 11.2 supports v15)');
            trace('version: ' + Capabilities.version);
            trace('date: ' + new Date().toDateString() + ' (' + Math.floor((new Date(2012, 7, 1).time - new Date().time) / 86400000) + ' days remain)');
            
            // use of both domainMemory and requestContext3D will require license starting Aug 1 2012.
            // http://www.adobe.com/devnet/flashplayer/articles/premium-features.html
            trace('domainMemory: ' + String(ApplicationDomain.currentDomain.domainMemory));            
            if (stage.stage3Ds.length != 0) {
                var stage3D:Stage3D = stage.stage3Ds[0];
                stage3D.addEventListener(Event.CONTEXT3D_CREATE, function (e:Event):void {
                    // if published without a license, flash player will only use software renderer
                    trace('context3D created: ' + e.target.context3D);
                });
                stage3D.requestContext3D();
            }
            
            // new events are dispatched when pausing and resuming
            stage.addEventListener(/* ThrottleEvent.THROTTLE */ 'throttle', dump);
            
            // capture other mouse buttons (these need the swf version to be 15)
            for each (var type:String in [
                'click', 'middleClick', 'rightClick'
            ]) stage.addEventListener(type, dump);
            
            // not in this movie: mouse lock
        }
        
        private function dump(e:Event):void {
            trace(e);
        }
        
    }
}