views:

84

answers:

1

I'm trying to parse an XML file of tweets as retreived from Twitter's restful API (http://apiwiki.twitter.com/Twitter-REST-API-Method:-statuses-user_timeline). The issue is, when I print it using:

tweetTextArea.text += xml..text;

I get the tweets. However, when I try the following, I get just numbers:

// Print all tweets.

for (var tweet : * in xml..text) {
    tweetTextArea.text += tweet;
}

I am seriously perplexed by this. I have scoured the WWW to try and find a decent comprehensive AS3 tutorial and specifically on E4X but haven't found anything that's helping me. I'm sure it's a minor issue.

What is happening?

Can I iterate through the tweets in a for-each loop or do I have to resort to using a standard for loop?

I'm using the code inside a MXML file, and will update with full source if necessary.

+1  A: 

Ok, there's a big difference between "for ... in" and "for each ... in" in actionscript. What you're trying to do would probably ask for a "for each" as it iterates through the items of an object/collection rather than properties, like "for" does.

Read more on loops in actionsctipt on: LiveDocs

Robert Bak
No code to help?
Beau Martínez
No code to copy paste. There are code samples under the link, maybe read the answer, look throught the link, figure it out, and if you can't, tell us where you're stuck.
Robert Bak