WanderPlayer is a console right in your phone, that lets you play games on any screen. Its API allows you to integrate your game with all of WanderPlayer’s interfaces, including WanderPlayer’s smartphone game interaction interface, allowing players to use all the features integrated into WanderPlayer on iOS or on Android.

The Flash API exposes the features made available by the WanderPlayer game interaction interface using standard Flash functions and events.


addEventListener(Event.ADDED_TO_STAGE, stageAvailable);

private function stageAvailable(e:Event):void {
    var api_url:String = "https://api.wanderplayer.com/1/wanderplayer.swf";

    // grant it access to call back

    // load it
    var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
    var request:URLRequest = new URLRequest(api_url);
    var raw:URLLoader = new URLLoader();
    raw.dataFormat = URLLoaderDataFormat.BINARY;
    raw.addEventListener(Event.COMPLETE, onRawLoadWanderPlayerAPI);

private function onRawLoadWanderPlayerAPI(e:Event):void {
    var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadWanderPlayerAPI);
    loader.loadBytes(e.currentTarget.data, context);

private function onLoadWanderPlayerAPI(e:Event):void {
    var loaderInfo:LoaderInfo = e.target as LoaderInfo;

    var WanderPlayerCls:Class = Class(loaderInfo.applicationDomain.getDefinition('com.orthogonal.remote.WanderPlayer'));

    wanderplayer = new WanderPlayerCls();

    // register for some events
    // whenever we successfully connect
    wanderplayer.addEventListener(WanderPlayerCls.onConnect, onWPConnect);

    // if the connection request fails
    wanderplayer.addEventListener(WanderPlayerCls.onConnectFailed, onWPConnectFailed);

    // whenever we are disconnected (either by us or by the server)
    wanderplayer.addEventListener(WanderPlayerCls.onDisconnect, onWPDisconnect);

    // whenever a new controller connects
    wanderplayer.addEventListener(WanderPlayerCls.onControllerConnect, onWPCConnect);

    // whenever an existing controller disconnects
    wanderplayer.addEventListener(WanderPlayerCls.onControllerDisconnect, onWPCDisconnect);

    // whenever a pad is pressed
    wanderplayer.addEventListener(WanderPlayerCls.onPadPressed, onWPPress);

    // whenever a pad is released
    wanderplayer.addEventListener(WanderPlayerCls.onPadReleased, onWPRelease);

    // all done: try and open a connection to the WanderPlayer Game Console
    wanderplayer.Connect("All Your Base Are Belong To Us", "476e017e-ec83-47c3-8738-044a7819f9ab");
Input . URL.