Well maybe it's a little bit late no what the hell it's damn late.
Anyway I think I have a solution which I think it might work for the most cases.
I split the text on whitespace because that's where the Textfield will make a linebreak if the "word"s width is larger than the Textfield width.
Next I need to determine what's the max textWidth of the Textfield by putting "i" in the Textfield (in my case 219.75 I rounded it up).
Then I need to add word by word to see if it's larger than the max textWidth and so on. Someday I might then get the textWidth of the last line.
PHP Code:
var my_array:Array = String(normal_txt.text).split(" ");
hidden_txt.text = "";
var temp_end:Boolean = false;
var length_lastline:Number;
for each(var wort:String in my_array){
if(hidden_txt.text == ""){
hidden_txt.text = wort;
}
else{
hidden_txt.text = hidden_txt.text + " " + wort;
}
if(hidden_txt.textWidth > 220){
temp_end = true;
hidden_txt.text = wort;
}
length_lastline = hidden_txt.textWidth;
}
if(temp_end){
mc.x = normal_txt.x + length_lastline + 12;
mc.y = normal_txt.y + normal_txt.height - 18;
}
else{
mc.x = normal_txt.x + length_lastline + 11;
mc.y = normal_txt.y + normal_txt.height - 21;
}
This is done in CS4 with Actionscript 3.0 not Flash 8. Maybe this thread should moved to Actionscript 3.0.