loaded
03-22-2003, 12:43 PM
if been UTFSM and browsing, but can't find a solution.
Point is I want to make a textfield rezise in height according to the lenght of text.
like for instance done in http://www.flash-tools.com/
got this but aint got a clue as to how to scale it to the text???
var myText = new Array();
myText[0] = "Just a little crappy story to test how to set a dynamic textfield height???";
myText[1] = "What about this one?";
for(i=0;i<myText.length;i++){
//vars
var myField = "text";
var myHeight = "100";
var myWidth = "100";
//length
trace(myText[i].length);
_root.createTextField(myField+i, i, 0, 0, myWidth, myHeight);
_root[myField+i].wordWrap = true;
_root[myField+i].autoSize = false;
_root[myField+i].border = true;
_root[myField+i].text = myText[i];
_root[myField+i]._x = 10;
_root[myField+i]._y = 10+(100*i);
my_tf = new TextFormat();
my_tf.font = "verdana";
_root[myField+i].setTextFormat(my_tf);
}
Point is I want to make a textfield rezise in height according to the lenght of text.
like for instance done in http://www.flash-tools.com/
got this but aint got a clue as to how to scale it to the text???
var myText = new Array();
myText[0] = "Just a little crappy story to test how to set a dynamic textfield height???";
myText[1] = "What about this one?";
for(i=0;i<myText.length;i++){
//vars
var myField = "text";
var myHeight = "100";
var myWidth = "100";
//length
trace(myText[i].length);
_root.createTextField(myField+i, i, 0, 0, myWidth, myHeight);
_root[myField+i].wordWrap = true;
_root[myField+i].autoSize = false;
_root[myField+i].border = true;
_root[myField+i].text = myText[i];
_root[myField+i]._x = 10;
_root[myField+i]._y = 10+(100*i);
my_tf = new TextFormat();
my_tf.font = "verdana";
_root[myField+i].setTextFormat(my_tf);
}