home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Puzzle / HexiomConnect.swf / scripts / TextButton.as < prev    next >
Encoding:
Text File  |  2008-08-29  |  1009 b   |  45 lines

  1. package
  2. {
  3.    import flash.display.MovieClip;
  4.    import flash.display.Sprite;
  5.    import flash.text.TextField;
  6.    
  7.    public class TextButton extends Sprite
  8.    {
  9.       
  10.       public static var LONG:Class = TextButton_LONG;
  11.       
  12.       public static var SQUARE:Class = TextButton_SQUARE;
  13.        
  14.       
  15.       private var button:MovieClip;
  16.       
  17.       private var label:TextField;
  18.       
  19.       public function TextButton(param1:Class, param2:String = "")
  20.       {
  21.          super();
  22.          button = new param1() as MovieClip;
  23.          button.stop();
  24.          button.buttonMode = true;
  25.          label = button.label;
  26.          if(label)
  27.          {
  28.             label.mouseEnabled = false;
  29.          }
  30.          addChild(button);
  31.          this.text = param2;
  32.       }
  33.       
  34.       public function set text(param1:String) : void
  35.       {
  36.          label.text = param1;
  37.       }
  38.       
  39.       public function get text() : String
  40.       {
  41.          return label.text;
  42.       }
  43.    }
  44. }
  45.