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

youtube

Get Adobe Flash player
by macomputer 29 Oct 2009

    Talk

    ysle at 29 Oct 2009 21:48
    http://apiblog.youtube.com/2009/10/actionscript-3-youtube-chromeless.html thx! :)

    Tags

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

package {
    import flash.display.Sprite;
    import flash.display.Loader;
    import flash.net.URLRequest;
    import flash.events.Event;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var player:Object = new Object();
            var loader:Loader = new Loader();
            
            loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);
            loader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));
            
            function onLoaderInit(event:Event):void {
                addChild(loader);
                loader.content.addEventListener("onReady", onPlayerReady);
                
            }
            function onPlayerReady(event:Event):void {
                player = loader.content;
                player.setSize(500, 380);
                player.cueVideoById("wE9zfm8HQF0", 0, "hd720");
            }
        }
    }
}