# Whats the best way to do this? maxsize prob

**URL:** <https://forum.kirupa.com/t/whats-the-best-way-to-do-this-maxsize-prob/194628>\
**Category:** Uncategorized\
**Created:** [July 25, 2006, 3:17am UTC](https://forum.kirupa.com/t/whats-the-best-way-to-do-this-maxsize-prob/194628 "2006-07-25T03:17:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![liquify](https://avatars.discourse-cdn.com/v4/letter/l/e95f7d/32.png) [@liquify](https://forum.kirupa.com/u/liquify)\
**Post date:** [July 25, 2006, 3:17am UTC](https://forum.kirupa.com/t/whats-the-best-way-to-do-this-maxsize-prob/194628/1 "2006-07-25T03:17:43Z")

</div>

hi!

I have a dynamic textfield that loads text from a txt file.  
The content of the txt file will be modified daily by the client.

What i need is that if there is too much text in the txt file, the dynamic textfield resizes (and not only with autosize because the text can be really long).

this is what i’m using:

i have the textield inside a mc which have this code

```auto

onClipEvent (load) {
	
	maxSize = 550;
	maxSizeY = 110
	
	myTextBox.autoSize = 'left';
	
	myTextBox.htmlText = _root.news
	
	if (myTextBox._width > maxSize) {
		percent = (maxSize*100)/myTextBox._width;
		_xscale = percent;
		}
	
if (myTextBox._height > maxSizeY) {
		percentY = (maxSizeY*100)/myTextBox._height;
		_yscale = percentY;
	}
	
}

```

it doesnt look very good but it works. The only problem is that if I have a really long text the maxsizeY doesnt work fine.

does anyone have a better code for this? or any ideas?

thank you so much!
