Jump to content
Search Community

XMLLoader Loading from different domain

rodoneill test
Moderator Tag

Recommended Posts

I'm trying to load several twitter xml feeds using XMLLoader e.g -http://twitter.com/statuses/user_timeline/egusername.xml with no success.

 

I can load this fine when using URLLoader, but when I use XMLLoader it doesn't seem to do anything, when listening to LoaderMax onProgress, it just returns 0% a few times and stops.

 

If I copy the twitter xml data into a local xml file, I can load this fine through XMLLoader - I'm assuming it's because I'm requesting from a different domain, but twitter has a crossdomain.xml file and like I said, URLLoader loads this fine.

 

FYI I'm getting the same problem debugging locally and running release build on localhost via wamp.

 

EDIT - It's obviously finding the xml, as it doesn't throw errors (it does if I modify the url), it simply won't load it....?

 

Thanks in advance.

Link to comment
Share on other sites

You would get an error because that Twitter username does not exist, I was using that as an example, sorry. try replacing it with my actual twitter username:

var l:URLLoader = new URLLoader();
l.addEventListener(Event.COMPLETE, test);
l.load( new URLRequest("http://twitter.com/statuses/user_timeline/rodoneill.xml") );

Link to comment
Share on other sites

Hmm, I was using version 1.18, updating to 1.191 has fixed the problem. Here's what I was running anyway, thanks again, LoaderMax is the best loader API I've used in years.

 

_usernames = new Vector.();
_usernames[0] = "haywirefilms";
_usernames[1] = "rodoneill";
_usernames[2] = "tezzling";

_loaderMax = new LoaderMax();
_loaderMax.addEventListener(LoaderEvent.COMPLETE, loadComplete);
_loaderMax.addEventListener(LoaderEvent.PROGRESS, onProgress);

var xmlLoader:XMLLoader;
for(var i:uint=0; i<_usernames.length; i++)
{
xmlLoader = new XMLLoader("http://twitter.com/statuses/user_timeline/" + _usernames[i] + ".xml");
_loaderMax.append(xmlLoader);
}

_loaderMax.load();

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...