forked from: YouTube apiplayer

by bradsedito forked from YouTube apiplayer (diff: 27)
♥0 | Line 50 | Modified 2010-10-27 03:42:23 | 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/bOp0
 */

// forked from psyark's YouTube apiplayer
package {
    import flash.display.AVM1Movie;
    import flash.display.Sprite;
    import flash.display.Loader;
    import flash.events.Event;
    import flash.net.URLRequest;
    [SWF(frameRate=60)]
    public class FlashTest extends Sprite {
        private var loader:Loader;
        private var player:Object;
        public function FlashTest() {
            x = stage.stageWidth / 2;
            y = stage.stageWidth / 2;
            loader = new Loader();
            loader.z = 100;
            loader.contentLoaderInfo.addEventListener(Event.INIT, loadInit);
            loader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));
            addChild(loader);
            stage.addEventListener(Event.ENTER_FRAME, enterFrame);
        }
        private function loadInit(event:Event):void {
            player = loader.content;
            player.addEventListener("onReady", playerReady);
            player.x = -stage.stageWidth / 2;
            player.y = -stage.stageWidth / 2;
        }
        private function playerReady(event:Event):void {
            player.setSize(stage.stageWidth, stage.stageHeight);
            player.cueVideoById("dt-1QCFEnBE");
        }
        private function enterFrame(event:Event):void {
            loader.rotationX = mouseY * -0.5;
            loader.rotationY = mouseX * +0.5;
        }
               
    }
    
}

// BradSedito Code Edit:
////  The goal here is to add some bad-ass dynamic effects to this.  
////  ...First i'll start by creating a custom matrix color transform class
class CustomColorMatrix {

        public static const MAX_BRIGHTNESS:Array =     [    1, 0, 0, 0, 100,
                                                        0, 1, 0, 0, 100,
                                                        0, 0, 1, 0, 100,
                                                        0, 0, 0, 1, 00];
        public static const SOFT_BRIGHTNESS:Array = [    1, 0, 0, 0, 50,
                                                        0, 1, 0, 0, 50,
                                                        0, 0, 1, 0, 50,
                                                        0, 0, 0, 1, 00];
        public static const BLACK_WHITE:Array =     [    0.3, 0.59, 0.11, 0, 0,
                                                        0.3, 0.59, 0.11, 0, 0,
                                                        0.3, 0.59, 0.11, 0, 0,
                                                        0, 0, 0, 1, 0];

    }
//// Awesome.  Now lets make it actually do something.

///// ill get to this later, promise.  A mans gotta eat.  hahaha later ;)