Forum GameFS Loading With GameFS Always Gives Null Object Reference

Discussion and help relating to the PlayerIO game asset hosting and CDN solution, GameFS.

Loading With GameFS Always Gives Null Object Reference

Postby JimLion » September 29th, 2014, 5:35 am

Hi. I am using the documentation for GameFS, but it is only half complete. It shows how to get a Url, but not an actual file. I tried using the permanent URL and also this (although they seem to be the same);

Code: Select all
var fs:GameFS = PlayerIO.gameFS("xxxxxxxxxxmygame");
var myfileUrl:* = fs.getUrl("/States/Login/Login_v1.swf");


And then here the documentation just leaves you hanging. So I tried to take this URL and put it into a Loader object:

Code: Select all
var oldLoader:Loader = new Loader();
oldLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
oldLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
myLoader.load(loaderURL);
oldLoader.load(new URLRequest("http://r.playerio.com/r/xxxxxxxxxxmygame/States/Login/Login_v1.swf"));


which yields this error: TypeError: Error #1009: Cannot access a property or method of a null object reference.

I also tried using loaderMax from greensock:
Code: Select all
var myLoader:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler});
myLoader.append( new SWFLoader("http://r.playerio.com/r/xxxxxxxxxxmygame/States/Login/Login_v1.swf",
            {name:"childClip", estimatedBytes:3000, container:this, x:950, y:600, autoPlay:false}) );
myLoader.load();


which gives exact same error: TypeError: Error #1009: Cannot access a property or method of a null object reference.

Please Help!
JimLion
 
Posts: 73
Joined: June 17th, 2014, 3:35 am

Return to GameFS