OK finally found a good way of limiting the number of lines. This will work even if you try to paste in a large amount of characters at once. In this instance i didn't want the text to expand such that there was a maxscroll of 15 lines, thus limiting my text to 20 lines (textShortWrite is tall enough to hold 5 lines on the screen at once).
apologies for the non standard formatting, I prefer to code in a 'tab hierarchy of conditions' style and I personally find it a lot easier to read than conventional actionscript style.
NB It is a good idea to have the condition that changes the textfield type first because otherwise the app can crash if the user pressess ctr + V very quickly with large chunks of characters on the clipboard. This way, the swf file will ignore all of these until it has already dealt with the first offending one.
Code:
this.textShortWrite.onChanged = function()
{
if (textShortWrite.maxscroll >= 15) //if the max number of lines is exceeded
{
//stop the user from any further editing for the time being:
textShortWrite.type = "dynamic";
}
while (textShortWrite.maxscroll >= 15) //starts if maxscroll >= 15
{
current_string = textShortWrite.text;
textShortWrite.text = current_string.slice(0, -1); //slice off the last character of current string
}//end of while loop. loop stops only when the maxscroll is 14 or less.
textShortWrite.type = "input"; //turn the box back to an input box, if it was changed
} //end of onChanged event handler