PDA

View Full Version : Numerically change TextField width without stretching?


Paradise
04-11-2007, 08:08 PM
How do you numerically change the width of a TextField without stretching the text?

TIA

CyanBlue
04-11-2007, 09:25 PM
Howdy and Welcome... :)

I think you can use textField._width to change that...

For example...
Create a new FLA...
Create a textField on the stage, make sure the border is turned on and give it an instance name of 'test_txt'...
Create a button and give it an instance name of 'a_mc'...
Create another button and give it an instance name of 'b_mc'...
Paste this script to frame 1 and do test movie...
test_txt.text = "Hello";

a_mc.onPress = function ()
{
test_txt._width = 50;
}


b_mc.onPress = function ()
{
test_txt._width = 150;
}

Paradise
04-11-2007, 11:48 PM
thanks but i should have clarified. i need a solution that allows me to modify a smattering of pre-existing dynamic textfields to all be the same width without using actionscript. basically i want to go down to properties after clicking on the textfield and type in 150 and have it expand the textfield to that size without scaling the text.

one person's name is so darn incredibly long that it won't fit in the size that was originally specified so they all need to be increased.

:(

CyanBlue
04-12-2007, 02:34 PM
Oh... Yeah that... :)

If you TYPE the values for the width and height of the textField, Flash resizes the textField... Don't know why they made it that way and I don't think anybody likes that 'feature', but there is no way getting around it...

The only option is to select the textField with the Text tool and use the corner of the textField to change the size...

Paradise
04-12-2007, 05:43 PM
yet another flash "feature" eh?

fudge. i could have sworn i did it for another project but maybe it's illustrator i'm thinking of instead of flash.

hopefully my new company will fly me out to an adobe conference so i can crack some skulls about this feature.

thanks for the help.

CyanBlue
04-12-2007, 08:16 PM
I don't think that's any use... We've done that before and it did not work... Maybe you should bring your heavy armour this time... :D

Paradise
04-12-2007, 08:52 PM
From what I've seen, if you bludgeon someone with something enough they'll relent.

I'll bring my mace (both spray and steel forms). ;)

CyanBlue
04-12-2007, 09:10 PM
Good luck with that... ;)