This content has been marked as final. Show 5 replies
1. make your textfield a mulitline textfield.
2. create a button handler for you resizeFont button
3. in that handler create a for-loop or while-loop to check your textfield's maxscroll property. while its greater than 1, decrease the font size. else break out of your loop. you're done.
Thanks for you help, I don’t suppose you could take a look at my script and tell my what I’ve done wrong, if I comment out the while look and keep pressing the button it works (I had some traces on the size and maxscroll).
I don’t know the best syntax to use as I don’t do much actionscript, so forgive me if it looks rubbish!!
But soon as I but a while or a for loop in there it gets stuck?
Have you any ideas what I’ve done wrong?
you need to setTextFormat() to change text that's already been entered into your textfield prior to you setTextFormat() statement.
and you need to make sure your textfield can only display 1 line of text without scrolling.
Thanks very much,
Changing setNewTextFormat() to setTextFormat() works
btw, the site you referenced uses a single line textfield (with invisible border) that autoSizes and uses the _width of the textfield to decide when to decrease font size.