scofieldly Posted November 30, 2016 Share Posted November 30, 2016 Hi all, I want to ask that is there any way to operate the loading file. what I want to do is when the file loading or waiting for the response more than 5 sec, I will stop this loading process and start a new loading from another url. I tried to customize the addToFileList function in the loader to replace the file in the Loader._fileList. but it seems the xhr loading request is still on-going. So, I wonder that can I just mark this loading as error to trigger the onError event in the loader, and stop the xhr request for this file. thx Link to comment Share on other sites More sharing options...
drhayes Posted November 30, 2016 Share Posted November 30, 2016 It sure looks like there's no "cancel" method. I was going to say you could wire something up by subscribing to the onFileStart signal, but I don't see a way to cancel a file. Maybe start there? Link to comment Share on other sites More sharing options...
samme Posted November 30, 2016 Share Posted November 30, 2016 If you can find the `file` entry you can call file.requestObject.abort(). I'm not sure how the Loader will treat an aborted request though. Is this for the Worst CDN Ever? Link to comment Share on other sites More sharing options...
scofieldly Posted December 1, 2016 Author Share Posted December 1, 2016 14 hours ago, drhayes said: It sure looks like there's no "cancel" method. I was going to say you could wire something up by subscribing to the onFileStart signal, but I don't see a way to cancel a file. Maybe start there? yes, currently I am make a timer in the onfilestart event, after 2 seconds, if it not complete, I will try to load the local one. but it looks like that the CDN request did not stop or cancel. Link to comment Share on other sites More sharing options...
scofieldly Posted December 1, 2016 Author Share Posted December 1, 2016 10 hours ago, samme said: If you can find the `file` entry you can call file.requestObject.abort(). I'm not sure how the Loader will treat an aborted request though. Is this for the Worst CDN Ever? yes, the CDN is bad, so this situation will appear. Link to comment Share on other sites More sharing options...
Recommended Posts