-
URLRequest / Loader not always returning correct information
Ran into a rather weird issue when loading some RSS
To give you an idea There is the defualt feed, and then the "improved feed"
http://www.mysite.com/info.rss
http://www.mysite.com/info.rss?watched&sortbydate
To be clear, the "improved" feed works 100% every time you load it in your browser, or any rss program, it will always load correctly.
HOWEVER, using the following code
Code:
var loader:URLLoader=new URLLoader();
loader.addEventListener(Event.COMPLETE, onRedDataLoad);
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
loader.load(new URLRequest("http://www.mysite.com/info.rss?watched&sortbydate"));
Here is the kicker, The above code is ran once every 180 seconds. The first time it runs, it will ALWAYS pick up the wrong feed (it will pick up "http://www.mysite.com/info.rss" as if the items at the end are not there, after that, it will pick up the correct feed 99% of the time, while once in a blue moon, it will not pick up the correct feed (and pick up the normal version)
does anyone have any ideas? this is driving me insane atm
-
(the edit button seems to be gone)
I should note that this is in adobe air
-
Total Universe Mod
It's possible you're getting cached results. You can usually force fresh data by attaching something to the url to guarantee it's unique.
Code:
loader.load(new URLRequest("http://www.mysite.com/info.rss?watched&sortbydate" + "&nocache=" + new Date().getTime()))
getTime() returns the number of milliseconds since 1970 so it's guaranteed to always be different.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|