3
votes

I would like to increase the size of the label on a Button in flash. The label seems to only be about 3/4 the width and 3/4 the height of the button. I would like to make the label be the full width and height of the button.

The label field is just a string, and changing the width/height on the textField property of the button does not seem to change anything. Also textFormat doesn't have options for changing text width/height.

I'm out of ideas. Any help would be greatly appreciated!

2

2 Answers

0
votes

The only way I know is to do it via code.

        var myTextFormat:TextFormat = new TextFormat();
        myTextFormat.size = 20
        var myButton:Button = new Button();
        myButton.label = "Click Me";
        myButton.setStyle("textFormat", myTextFormat);
        myButton.setSize(120, 60);
        myButton.x = 0;
        myButton.y = 0;
        addChild(myButton);
0
votes

After much reading, I found a few that might help future viewers of this question. I am using AS3, CS5.5. 'bw' is the instance name of the button. These can be used if you are using a button 'Component'.

bw.setStyle("textFormat", new TextFormat("Verdana", 20, "bold", "italic", "underline", true));
bw.label = "Dog Snacks"; // can be also set via properties, but this is handy if you want the text to change after clicking
bw.setSize(280, 30); // can also be set via properties