View Full Version : Grow dynamic text field vertically
kidap
02-28-2008, 07:09 PM
I know you can expand the width of a text field horizontally with the .autosize property but i need to a text box's height to expand based on XML loaded text length. Is there a way to do this. I am loading a vertical list of components, each of which has a thumbnail photo and a brief description below it. The description is variable length and I want each component to be right under the next. If I give it the same amount of space for the description, the will sometimes be a gap and sometimes the text will be cut off. Any clues?
julcan
02-29-2008, 06:27 PM
import mx.controls.List;
var my_list:List;
// create a new XML object
courses = new XML();
courses.ignoreWhite = true;
courses.load("fast.xml");
courses.onLoad = function(success) {
coursesNode =this.childNodes[0];
//scroll through xml list
for(i=0;i <coursesNode.childNodes.length;i++){
coursesNode =this.childNodes[0];
addList = coursesNode.childNodes[i].attributes.name;
my_list.addItem({label:addList, data:addList}); //add item in list
my_list.vScrollPolicy = "off"; //turn off vertical scroll
my_list.setSize(200); //(width , height) - setting the width only
my_list.rowHeight = 30; //spaces between each list item
my_list.rowCount = my_list.length; //height determine by list in xml
my_list.selectable = false; //items in list not selectable
}
}
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.