【发布时间】:2013-04-12 16:09:35
【问题描述】:
我正在制作一个聊天应用程序,我想将单个文本字段添加到 mc,以便用户可以自定义这些文本字段,即背景、字体和其他内容。为此,我必须获取文本字段的高度,因为我需要它来放置下一个文本字段(高度 = 下一个文本字段的 Y)
我尝试了多行和自动换行,但它只显示 1 行... 我也尝试过 AUTOSIZE = left 但是......它在最后增加了一个巨大的不必要的空白
代码如下 在此处输入代码`for (i=0; i
// Apply some text to the textfield
boxMC.txTitle.htmlText ="<div style='width:50px'>Instance:aefvasdfawe efaegfawegfaw egawerg alejr joaej alejuf owirt a iajsejrt a aopeu rt tauwe taiej r aiejrt a mc"+nextYPos+"</div>";
//attach the newly created instance to the container
myContent.addChild(boxMC);
//set y value for next item
boxMC.txTitle.width = 100;
boxMC.txTitle.autoSize = "100";
boxMC.txTitle.wordWrap = true;
boxMC.txTitle.multiline = true;
nextYPos+=boxMC.txTitle.height;
}
【问题讨论】:
标签: actionscript-3 flash height autosize