AS3 TextButton Class

I’ve written a class that greatly simplifies the process of creating a button from a simple text label. The simplest example of creating a new instance of a TextButton is as shown:


var home:TextButton = new TextButton("Home");
addChild(home.button);

It also supports setting the style of each button state via a TextFormat object, as well as the ability to use embedded fonts.

Full source, docs and examples here: http://blog.duncanhall.net/2010/02/actionscript-as3-text-button-class/

Let me know what you think.