Breaking a TextField into lines

Is there a proper way to break a multiline text field with wordwrap into lines?

Here is the hack I came up with:


for(var i=0; line=tf.getLineText(0); i++){
	tf.text = tf.text.substr(line.length);
	lines* = line;
}

See, getLineText(1) is undefined, because since it word wrapped, it is technically 1 line line. Thanks to my near-god-like skills, I was able compensate, but I still wonder if there isn’t a better way. This way works fine, but doesn’t seem to work with htmlText.