Tweet parser to format urls in your text fields

November 30th, 2009

A while back I created a tutorial on Active.tutsplus.com on how to create a twitter widget for your website. This tutorial has resulted in a lot of emails and great comments from people who have viewed it.....mostly good thankfully and a lot for help and advice on how to manipualte tweets etc. A few recently were about formatting the links in tweets to be clickable in a normal text field in flash. This is incredibally simple if you know how and so I have created a simple class which would parse your tweet, format the url into a 'href' tag and assign your chosen colour to the link. Then once added to a text field as htmlText would function the same as a clickable link on any web page.

The class is available here and all you need to do is include it in your source files and as the method is a public static function you do not need to instantiate it you just make reference to it like so:

Actionscript:
  1. myTwitterWidgetTextField.htmlText = TwitParser.parseTwit(pulledInTweet, 0x00FF00);

The two parameters needed are the text to be parsed and a hex value for the color of the link text...and thats it!

Happy tweeting!

Categories: Actionscript 3.0 | Tags: ,

1 Comment

  1. Tweets that mention Tweet parser to format urls in your text fields | UltraVisual Blog -- Topsy.com

    [...] This post was mentioned on Twitter by yamasas, shane johnson. shane johnson said: New blog post – Tweet parser to format urls in your text fields http://bit.ly/4GAaJw [...]

Leave a comment