myTweets Twitter Flash Badge

UPDATE: Twitter modified their crossdomain policy, which put an end to the flash fun. In other words, this doesn't work anymore. *sigh*

I wanted a Twitter badge for my site and Twitter is so easy to work with that I decided to whip one up that anyone can use.

The myTweets flash badge displays up to twenty of your public timeline tweets and offers a few customization options via flashVars.

var so = new SWFObject("myTweets.swf", "myTweets", "100%", "100%", "8", "#333333");

so.addVariable("userID", "1905521");

so.addVariable("total", "10");

so.addVariable("timer", "8");

so.addVariable("dateHex", "0xEAEAEA");

so.write("flashcontent");

bgcolor - via the embed

userID - mine is 1905521

total - total number of tweets you want to display, up to 20

timer - time between tweets in seconds

dateHex - color of the date Twittered text

The example above is at http://davecurry.net/myTweets/.

If you'd like to put myTweets on your site, here's a zip of the example.

Update: I've written an AS3 version too. Check out Talking to Twitter via Actionscript 3.0 for more info and source files.

07/10/2007 in Articles, Flash




Comments

eerkmans said:

Great stuff. No FLA for download I suppose :-b

November 22nd, 2007 at 8:32 am


Dave said:

Check out this post. It’s the AS3 version and source files are included!

November 22nd, 2007 at 9:02 am


Digiguru said:

Your update says twitter changed there cross domain policy. Is there any reference to this you can point to as I’m not sure when this has changed.

June 3rd, 2008 at 11:51 am


Aaron said:

No reference necessary. If you’re looking to verify, just go to http://www.twitter.com/crossdomain.xml and view source. What must have at one time said allow-access-from domain=”*” now says allow-access-from domain=”*.twitter.com”

Does it matter when this changed? Or merely that it has?

If you’re using the embed code for a badge hosted on twitter.com, that will still work. But if your SWF is hosted elsewhere for any reason, it will no longer communicate with any script on twitter’s server.

(If I had to guess, I’d say this is a response to countless security violations, and that the server’s been a good deal more stable since they made this decision.)

July 29th, 2008 at 2:33 pm


Leave a Comment