Aerion Posted October 9, 2017 Share Posted October 9, 2017 Hi folks. Been messing around with Phaser again, and I've got a question. How do I grab both the directory AND file name FROM an ALREADY LOADED XHR file, OR the file name AND directory from a 404'd XHR? I want to use an asynchronous function to grab what's in the console XHR file tab and store it in either in an array or a string for later use. Thanks a ton! ~Mythros <3 Link to comment Share on other sites More sharing options...
Aerion Posted October 9, 2017 Author Share Posted October 9, 2017 Anyone? Link to comment Share on other sites More sharing options...
samme Posted October 9, 2017 Share Posted October 9, 2017 The URL should be in the Cache item somewhere. For load errors, you may be able to find it in the load queue, or you may have to add your own error handler. Check the docs for Phaser.Cache and Phaser.Loader and dig around with console.log. Link to comment Share on other sites More sharing options...
Aerion Posted October 11, 2017 Author Share Posted October 11, 2017 Thank you, but this doesn't answer my question. Is there not a demo somewhere to do this? Thank you! <3 ~M Link to comment Share on other sites More sharing options...
samme Posted October 11, 2017 Share Posted October 11, 2017 I'm afraid it's not clear what you're asking then. Link to comment Share on other sites More sharing options...
Aerion Posted October 11, 2017 Author Share Posted October 11, 2017 (edited) @samme Ok, basically what I'm asking is I want to grab the names of all the ALREADY LOADED files & their locations ( http://mysite.com/blah/myplayer.png ) that show up in the Debug Console in the 'Network' tab where all the loaded files show. If you need a more in-depth answer, please do let me know! Thanks alot buddy! <3 ~M Edited October 11, 2017 by Mythros Link to comment Share on other sites More sharing options...
Aerion Posted October 11, 2017 Author Share Posted October 11, 2017 Here's what I'm talking about. When you hover over the .json file, this link shows up. Link to comment Share on other sites More sharing options...
samme Posted October 11, 2017 Share Posted October 11, 2017 See Phaser.Cache#getItem. You can use property='url'. You can also use any of the other Cache#get* methods and read the url property from the result. Link to comment Share on other sites More sharing options...
Recommended Posts