【发布时间】:2013-03-03 00:33:20
【问题描述】:
我正在通过基于 XML 文件的循环添加一系列文本字段。字段的宽度始终为200 px,因此根据 XML 节点中包含的文本量,文本字段的高度会有所不同。我需要一种方法将这些字段堆叠在一起,根据它们的高度加上每个字段之间的10 px 空间。以下是我创建文本字段的方式。
for(var i:int; i < xml.item.length(); i++)
{
var theText:TextField = new TextField();
addChild(theText);
theText.wordWrap = true;
theText.width = 200;
theText.antiAliasType = AntiAliasType.ADVANCED;
theText.autoSize = TextFieldAutoSize.LEFT;
theText.selectable = false;
theText.htmlText = xml.item[i].@theText;
};
【问题讨论】:
标签: actionscript-3 flash actionscript textfield