whatever 6

by wh0
You guys like cats, right? Of course you do, you're on the Internet.

Seen in this movie:
YouTube ActionScript 3.0 Player API <http://code.google.com/apis/youtube/flash_api_reference.html>
custom metadata <http://cookbooks.adobe.com/post_Custom_metadata_in_three_simple_steps_-11907.html>
import loading <http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/LoaderContext.html#securityDomain>
runtime namespaces <http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Namespace.html>
♥0 | Line 29 | Modified 2011-06-23 13:00:43 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.*;
    import flash.events.*;
    import flash.net.*;
    import flash.system.*;
    import flash.utils.*;
    public class FlashTest extends Sprite {
        
        public function FlashTest() {
            // load the api movie
            var l:Loader = new Loader();
            l.contentLoaderInfo.addEventListener(Event.INIT, apiInit);
            l.load(new URLRequest('http://www.youtube.com/apiplayer?version=3'));
        }
        
        private function apiInit(e:Event):void {
            // look up player url
            var url:String = describeType(e.target.content).metadata.(@name == 'Params').arg.(@key == 'swf').@value;
            // no need for api movie anymore
            e.target.loader.unloadAndStop();
            // import-load player movie into
            var l:Loader = new Loader();
            l.contentLoaderInfo.addEventListener(Event.COMPLETE, playerComplete);
            l.load(new URLRequest(url), new LoaderContext(true, ApplicationDomain.currentDomain, SecurityDomain.currentDomain));
        }
        
        private function playerComplete(e:Event):void {
            // instantiate asset
            var themes:Namespace = new Namespace('com.google.youtube.ui.themes');
            var handle:MovieClip = new themes::CatTheme_Handle();
            // set up
            handle.gotoAndStop('up');
            handle.x = 220;
            handle.y = 220;
            addChild(handle);
        }
        
    }
}