Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a self resizing input text box.

Status
Not open for further replies.

jubalj

IS-IT--Management
Oct 5, 2003
13
NZ
I am a newbie when it comes to flash, currently using MX 2004.

Is it possible to create an input text box that automatically (vertically) resizes itself, when it detects that it is not large enough to hold the entered text.

There are plenty of examples of scrolling, but this is not what I want it to do. Basically it should just grow the input text box to accomodate the enetered text, and preferrable push down any other components below it.

I guess something that looks like: (Probably doesnt look anythin like what the workin code though?)

"
on (keyPress &quot;<Space>&quot;) {
if (mytext_txt.scroll > 0) {

//something to detect if the box has scrolled.
mytext_txt._height += 10;

//humm.. anyone know who the hight could be increased without scalling the text?

}
}&quot;

I'd appreciate any help/pointers.
Jubal
 
Have you looked at TextField.autoSize in the AS dictionary?

That should take care of the textfield itself...

As for lowering the rest below according to the textfield's size, guess you would have to put the rest of the lower elements in a movie clip and position it according to the textfield's height.

Regards,

cubalibre2.gif
 
Thanks for that..

this.text4_txt.autoSize = &quot;center&quot;;

does exactly what I want, however, if i try to convert the text box into a symbol or add it to the library it doesnt autosize anymore? anyidea why this would happen?

Regards
Jubal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top