Цитата:
|
Как в multiline поле вычленить строку?
|
вариант:
создаем временный текстфилд с autoSize=true и по нему смотрим сколько слов из основного текстфилда влезет по ширине, ну и удалим..

Код:
this.createTextField('_txt',0,0,0,180,140);
_txt.border=_txt.wordWrap=true;
_txt.text='То есть в текстовое multiline поле выводятся сообщения, а потом они должны сдвигатся построчно...'
TextField.prototype.delLine=function(){
var tmp_txt=_root.createTextField('tmp',_root.getNextHighestDepth(),0,0,0,0,0);
tmp_txt.autoSize=true;
var words=this.text.split(' ');
var i=0,s=tmp_txt.text;
while(tmp_txt._width<this._width) {
s=tmp_txt.text;
tmp_txt.text+=words[i++]+' ';
tmp_txt.setTextFormat(this.getTextFormat());
}
this.text=this.text.split(s).join('');
tmp_txt.removeTextField();
}
//повесим действие на клик
onMouseUp=function(){
_txt.delLine();
}