Flash will work neatly in combination with the Twitter API to create a Twitter widget for any webpage. Follow Shane Johnson (@ultravisual) as he demonstrates building an interface, pulling in specific XML data and tackling cross-domain policy issues..
















User Comments
( ADD YOURS )wink May 8th
Nifty, yes… Ugly, yes…
( )Dario Gutierrez May 8th
Interesting API, actually I’m developing a similar application like yours. Great tutorial.
( )Diego SA May 8th
Yes, it’s nifty, but it need to be improved… I mean, it doesn’t have a good face, you know?
( )But it’s useful for a flash designer’s website.
samBrown May 8th
nice tutorial, thanks for the post
( )Franky May 8th
Legit. I love it
( )karthikeyan vj May 8th
to avoid the cursor changing on text area….
textBox.mouseChildren = false;
( )CgBaran Tuts May 9th
Great tutorial thanks
( )backcountrygen May 9th
This is actually what I was looking for. It works great. Thanks
( )Clemente G May 9th
Cool Tut
( )Chatton May 10th
that’s good to have tutorials showing us how to use the document class!
I’d love more about that, and how to link AS files with the document class, how to organize them and so on..
Really good tutorial to me since i’m learning AS3 on my own, keep up the good work pal
( )ctsf May 20th
Your tut is awesome. I’m far from a programmer and your explanations for customization are fantastic. With a little luck I can make it work. Thanks so much
( )Overtrack May 22nd
This is a realy nice tutorial !
Nonetheless, i have this error : Warning: stream_get_contents() expects parameter 1 to be resource, boolean given in /homez.184/overlutz/www/twitFeed.php on line 7
Any idea?
( )Overtrack May 23rd
Hey it’s me again ! I just tested the fopen() with some other url and that works fine. It’s just with Twitter that this doesn’t work. I don’t understand…
( )vector June 16th
Also getting this error. Any help would be appreciated.
vector June 17th
I had someone that knows php way more than I do look at this error. Apparently there is a php security setting on your server that you can adjust, something about ini, that will allow for this to work.
As you can see I have no idea what i’m talking about with php but he put it on his server and it worked fine.
just fyi
Overtrack May 24th
Hello again,
I now know what the problem is and maybe some of you will have the same…
Twitter allows a maximum of 100 requests per hour and per IP. If your website is hosted on a mutualized hosting, that means that you and thousand of websites are sharing the same IP.
That means that many requests can be send to Twitter in a short range of time.
For exemple, on my mutualized hosting, the 100 requests are exeeded in less than 60 seconds.
Do you think there is another way without send a request to Twitter for this tutorial?
PS : Forgive me for my bad english.
( )Siniestro May 27th
Using this widget on a company site that uses a fancy dancy CMS and it contacts twitter but never ends up retrieving any tweets to populate the text boxes… any suggestions????
( )socal May 28th
i can’t get this widget to work. i loaded it to my site along with all the other files after i edited them. none of the tweets get pulled into the widget, but the follow me button works. any ideas?
( )Shane Johnson May 29th
Hi Guys,
Any one who is having problems if you send me your files and I’ll have a little look and see whats wrong…
Shane
( )Michelle May 29th
Hi Shane,
I’m trying to use your method here but in 4 instances of a dynamic text box (not a text field component as you’ve used in your tutorial) – I can’t get it to work – any idea what could be wrong/different?
( )Shane Johnson June 3rd
Hi Michelle,
With a dynamic text field, as long as they are named the same way as the text box I used in this tutorial, you would just need to do:
box[i].text = “twitter xml data here”;
Any more probs please email me more info.
Shane
HORCRUXES June 12th
Hi Shane,
It took me a lot of time figuring out the errors and somehow I manage to fix those mistype/mispelled and such, but I do have a problem of not showing anything on the 4 box. and I recieve this output:
Error opening URL ‘http://twitter.com/statuses/user_timeline.xml?screen_name=HORCRUXES’
( )Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://twitter.com/statuses/user_timeline.xml?screen_name=HORCRUXES
at Twitter_Main/initTwit()
at Twitter_Main()
I
First of I have no knowlege of ActionScript cause we haven’t learn yet.lol. I please you to help me cause this tutorial is addictive.
Thanks
Alejandro July 22nd
hi shane, I have some problems with te action spcript,
LINE 54
1046: Type was not found or was not a compile-time constant: Event.
CAN YOU HELP ME?????
THANKS…
( )brothergreg October 21st
Please shane, what is your email add…
( )Ray May 29th
Hi shane, ive just emailed you my files
( )Dimitree June 1st
How can I change the size of text in textarea?
( )Shane Johnson June 3rd
Yep just change the font and size by adjusting the proerties of the textarea in flash.
Shane
( )bizzau June 12th
can this be used as a module in joomla?
( )e11world June 15th
I wonder if you have time to create an AS2 version of this? I still haven’t migrated yet (I’m sure many haven’t too).
( )Keith June 21st
Great tut, but when I run my swf I get the following errors:
TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/replaceText()
at flash.text::TextField/appendText()
at fl.controls::TextArea/appendText()
at Twitter_Main/loaded()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
I have also had to modify some settings of the flash player to allow access to the localhost (testing this locally first before deploying) so will everyone who views the live site have to do the same?
I am completely new to flash so sorry if there is an obvious fix. I actually stumbled on your tut trying to find a way of embedding the twitter widget into my flash site.
( )philip July 2nd
Hello,
I’d also like to thank you for a great script.
However, I’m running into a problem with the PHP script side of things. Apparently the function stream_get_contents is only for PHP5. I don’t have the back-end info for the site I’m currently working on, but I’d guess it’s PHP4.
Is there any PHP4 workaround for the stream_get_contents? Or am I missing something else?
many thanks,
( )philip
Bob July 29th
This tutorial is missing key steps in order to successfully replicate.
If it wasn’t, 1/2 the comments above would not be present.
( )Sarah Sullivan August 12th
Terrible, terrible, terrible.
Come on—the owners of this site HAVE to enact some form of quality control. This does not work. Download his source—it’s missing vital pieces of scripting for this to even come close to functioning.
2/3 of this awful tutorial is devoted to his pink button gradients.
Shame.
Post RELEVANT, COMPLETE, and USEFUL tutorials if you want people to return to your website, and recommend it to others.
Epic fail.
( )June August 24th
has anyone gotten this to work? I think I am having crossdomain.xml issues.
( )Can someone shed some light here? I thought I correctly put the crossdomain file in the root folder..but nothing..
June August 24th
I get this error? Can someone help?
TypeError: Error #1088: The markup in the document following the root element must be well-formed.
( )at Twitter_Main/loaded()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
Chris September 11th
got this working, thanks for the tweet tute… i was wondering how you could extend this to bring back only items tagged with the # hashmark as in search or retweet… any thoughts?
Thanks!
( )phatcafer September 14th
there’s so many “mad flash professors” out there. actually few of them are able to explain as3. this tutorial can re-encourage lost flashers to a certain extend.
well done.
( )i like your accent.
Brothergreg October 21st
Hello, I search for hours to find this, thanks, I have one problem I hope you will help me out with. When I test the movie from flashcs4 itself it works and pulls the feed I want, yet when I try to play the swf file from the saved folder, or upload them to my server the text aera’s remain blank…please help
( )MSFX November 4th
i’d recommend using the Proxy script found at :
http://www.republicofcode.com/tutorials/flash/twitter_widget/3.php
This is a far more secure method…
( )