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

forked from: YouTube API

YouTube API
Get Adobe Flash player
by Hiiragi 13 Sep 2010
/**
 * Copyright Hiiragi ( http://wonderfl.net/user/Hiiragi )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/dOJ8
 */

// forked from ProjectNya's YouTube API
////////////////////////////////////////////////////////////////////////////////
// YouTube API
////////////////////////////////////////////////////////////////////////////////

package {

    import flash.display.Sprite;
    import flash.display.StageScaleMode;
    import flash.display.StageAlign;
    import flash.display.Loader;
    import flash.display.DisplayObject;
    import flash.events.Event;
    import flash.net.URLRequest;
    import flash.system.Security;
    import flash.system.LoaderContext;
    
    [SWF(backgroundColor="#FFFFFF", width="465", height="465", frameRate="30")]

    public class YoutubeTest extends Sprite {
        private var player:Object;
        private var loader:Loader;
        //private static var youtubePath:String = "http://www.youtube.com/cp/ZL5d6vPEhMw?version=3&enablejsapi=1";
        private static var youtubePath:String = "http://www.youtube.com/cp/vjVQa1PpcFPdkoibZPNE8K23dvrQAu8KI4oHUH78i3M=";
        private static var playerWidth:uint = 352;

        public function YoutubeTest() {
            //Wonderfl.capture_delay(1);
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP_LEFT;
            init();
        }

        private function init():void {
            //Security.allowDomain("*");
            var context:LoaderContext = new LoaderContext(true);
            //Security.allowDomain("www.youtube.com");
            //Security.allowDomain("s.ytimg.com");
            //Security.loadPolicyFile("http://www.youtube.com/crossdomain.xml");
            loader = new Loader();
            addChild(loader);
            loader.x = 0;
            loader.y = 0;
            loader.scaleX = loader.scaleY = 0.6;
            loader.contentLoaderInfo.addEventListener(Event.INIT, initialize, false, 0, true);
            loader.load(new URLRequest(youtubePath), context);
        }
        private function initialize(evt:Event):void {
            //init
        }


    }

}