Posted by Sandro on March 1st, 2009

Open sourced: Tweetr


UPDATED: Tweetr has gotten an Update since this blog post. See this blog post for more infos.

While i was developing  Twidget , i started building up a AS3 Library for using the Twitter API, since the only other library i found seemed a bit painful to use.

So after taking some additional time to generate all the needed methods, data objects and inline documentations, i am happy to announce that “Tweetr” is available for public consumption over Googlecode :).


  • includes practically all twitter api methods
  • includes twitter search api
  • includes a URLShortener Class which utilizes

Since twitter has a very restricted crossdomain policy, at the moment, tweetr can only be used for AIR/Zinc or Launcher Applications since they have ways to circumvent the Crossdomain problem.

I will be working on a simple php wrapper class that i can include with tweetr so you could use it for website integration. If you are interested in Tweetr’s future, there is also a small Roadmap up on the Wiki pages.

Nothing left to say than go and grab it while it’s hot:

Related Posts
Post a Comment


  1. Wow! amazing! But i can’t really figure out the API just yet. When are the examples coming?

    I tried making a Tweetr and do a sendTweet but for now it had no results. I’m really excitedabout this!

  2. Sandro says:

    Hi Kjelle

    I will be releasing examples as soon as i’m done with the PHP Proxy for Tweetr which will be part of the next release. I expect this to be within this or next week.

    Keep in mind that Tweetr at the moment only works for AIR Applications and/or other similar runtimes like Zinc or Launcher since twitter has a rather strict crossdomain policy.

    Either way, you can try the following example from within Flex or Flash and run it, since the sandbox doesn’t act up within the IDE’s. So, that said, here’s the example on how to use sendTweet:

    //create a new tweetr instance
    var tweetr:Tweetr = new Tweetr();
    // add your login credentials
    tweetr.username = "yourUsername";
    tweetr.password = "yourPassword";
    // add some event listeners for when a request succeeds or fails
    tweetr.addEventListener(TweetEvent.COMPLETE, handleResult);
    tweetr.addEventListener(TweetEvent.FAILED, handleFail);
    // now send your tweet
    tweetr.sendTweet("my test tweet");

    When your request succeeds, the handleResult Method will receive a TweetEvent containing a StatusData within the responseArray.

    That StatusData Object will be equal to the tweet you just made. Which is the exact same behaviour as defined by the actual twitter rest api.

    Hope this helps to get you started.

  3. Waauw thanks for the quick answer. I’m gonna try it right now. I was searching for an easy twitter library for my current adobe AIR project. So I’m really happy that I found Tweetr, it seems like the perfect solution to my problem.

    I’m looking forward to seeing this project evolve.

    Thanks man :)

  4. Just tested it and it works just fine. Thank you so much! I’m gonna play around with all the other stuff you’ve implemented.

    Thank you !

  5. Igor says:

    Hi Sandro,

    Thanks for nice code library. However, can you tell why some POST methods don’t work?

    For example, friendships/destroy method seems don’t work. However, it is seen in your library.

  6. Igor says:

    Also, another point:

    I’ve launched your example code posted above in Flash IDE and got following:

    Error opening URL ‘’

    Tweets failed!

    Where xxxxx and yyyyy is actual username and password.

    What should I do have your example working?

    Looking forward to your answer!

  7. Igor says:

    Thanks for great library! It works in AIR very well. Thank you!!!

  8. Sandro says:

    Hi Igor

    when you use the Libary for a simple Flash IDE Project you might have to upload the compiled swf to a server to actually get it working. Seems that the connection gets blocked through the Flash IDE for most people.

  9. SEAN says:

    Hi Sandro

    Awesome work! I have run into a problem and have a feeling that it has to do with server setup. I continuously get the Authentication Required window from the browser whenever I am looking to do something that requires a username and password.

    I am able to populate a datagrid just fine when accessing the public timeline, so I know that the proxy is working OK.

    Any thoughts?

    Thanks in advance,

  10. Praveen says:

    Hi Sandro,

    Awesome job man. I tried using it in my local machine for a Flex web application. There’s no response returning.

    1. How do i proceed ?

    2. How come your example is working fine on the web ?

    3. Can i use the PHP proxy to make my application work fine with the Tweetr API ? If Yes, kindly guide me.

    Pls reply. Thanks in advance.

  11. Nate says:


    I’m using this library for a work project and it works great when I run it from Flex, but as soon as I try to deploy it anywhere I get a flash security error: Error #2156: Port 1 may not be accessed using protocol http.
    at com.swfjunkie.tweetr::Tweetr/getUserTimeLine() line 295

  12. Nate says:

    Setting browserAuth to false solved the problem. The comments in the source code say that this only needs to be set to false for AIR but apparently that’s not the case.

  13. Praveen says:

    Hi Nate,
    Can you shed some light for my problem here.
    Please share the code sample if any.

    Thanks in advance.

  14. Camilo says:

    Hey Sandro,

    First of all I just want to say amazing work! I am learning a lot from it. I got a couple of questions man… I am making a FLEX application that shows the latest tweets depending on a keyword, the idea is that the app updates actumaticall, like updates in runtime.

    So, Im using a Timer, that launches an event every 5000 miliseconds, and every time that event fires I refresh a data grid with the response array returned by the search method of your class. But its not behaving well.. sometimes it updates instantly and anothers not… Ill appreciate any help.

    Thanks in advance

  15. Hi Sandro,

    I try to implement simple application using library. I am getting this error.

    Error #2048: Security sandbox violation:

    can you please help me to find out what will be wrong?



  16. Nico says:


    ähm your API is great – no qestion. But since you update it, it doesn’t work with air?

    greets, nico

  17. Hey Sandro – thank you for all your hardwork – I’m sure it’s no easy task trying to support this. It’s a cool API.

    I’m having huge troubles with the Proxy script. I can point to your servistHost and run authenticated getUserTimeline, but when I try to use the proxy script on my server, it fails. But the proxy script works on my server if there is no auth required (like on getPublicTimeline() method). Have you updated the proxy php script or has something changed on Twitter’s end?

  18. Dan says:

    Exactly what I needed. I have one question though:

    Will there be any Twitter “Nearby” support in the future?
    This would allow a similar feature to Tweetie 2 where you can see people who tweet near you.


  19. I’m truly enjoying the design and layout of your site. It’s a very
    easy on the eyes which makes it much more pleasant for me to come here and visit more often.
    Did you hire out a developer to create your theme?
    Superb work!

  20. This is very interesting, You are a very skilled blogger. I have
    joined your rss feed and look forward to seeking
    more of your magnificent post. Also, I’ve shared your site in my social

  21. Il me tarde de lire votrе prochain article

  22. Ѵous ոous concoctez toujours des posts fascinants

  23. Je vɑis terminer de regarder tout ça apгès

  24. C’еst ɗu plaisiг de parcourir ce site internet

  25. On peսt vous dire ԛuе ce n’est guère inexact !

  26. Isis says:

    Unе fois Ԁе plus un article еffectivement captivant

  27. Poste trèѕ fascinant

  28. Je ո’ai guère terminé de lire cependant je reviendrai dans la soirée

  29. Un extrêmе remerciiement au webmaster du site

  30. Vivemeոt un aսtre article

  31. On гemarque immédiatement que vous maîtrisez superbement bien ce que vouѕ dites


RSS feed for comments on this post | TrackBack URL

Leave a comment

Flash Flex Actionscript Tutorials Tutorial AS2 AS3 AS1 Feeds MXML Blog Zinc AIR Launcher Twitter Tweetr Yet Another Coverflow Liip Adobe Macromedia PHP MySQL PostgreSQL XML AMF MXNA Phidgets Schweiz Switzerland Suisse Svizzera Fribourg Freiburg Aargau Baden Publicis Accessibility JAcc Qt FOSDR Flash on the Beach Forum Conference Speaker Speaking Talk