Loading Twitter XML in Flash CS5.5 Actionscript 3 for Android /iOS
This is probably a stupid question but I have spent the last 5 days searching the net and trying different ways to load a twitter feed into my air application for android (I would like to port it over to iOS but it needs building first)
The best results I had was loading the twitter XML feed
var xmlData:XML = new XML();
var theURL_ur:URLRequest = new URLRequest("http://twitter.com/statuses/user_timeline/weliebeneath.xml");
var loader_ul:URLLoader = new URLLoader(theURL_ur);
loader_ul.addEventListener("complete", fileLoa开发者_C百科ded);
function fileLoaded(e:Event):void
{
xmlData = XML(loader_ul.data);
txt.text = xmlData.text;
}
But it will not load into my dynamic text box. Any ideas?
I'm not going to comment what you did wrong in your code .. but all i can point you to is to dig some resources about XML in action script cuz this is a wide useful topic
here is what the code should look like
var xmlData:XML;
var loader_ul:URLLoader = new URLLoader();
loader_ul.load(new URLRequest("http://twitter.com/statuses/user_timeline/weliebeneath.xml"));
loader_ul.addEventListener(Event.COMPLETE, fileLoaded);
function fileLoaded(e:Event):void {
xmlData = new XML(e.target.data);
txt.text=xmlData;
}
精彩评论