Hi,

I've got an as2 implementation maybe you can convert it (and clean it:)):

//nametextfield contains actual text. Check what is smaller the actual
width of the textfield or a combo of the available width +
margin+dotwidth
//50 == margin, 20== correction, +5 == no clue old code;))
//so the actual width is the minimum of the textWidth and the given width
this.nameTextField._width = Math.min
(this.width-50-this.dotTextField._width,
this.nameTextField.textWidth+20)+5;
//position dots behind main textfield
this.dotTextField._x = this.nameTextField._x+this.nameTextField._width-2;
//determine visibility on whether text in nametextfield fits or not
this.dotTextField._visible = (this.nameTextField.textWidth >
this.nameTextField._width);

greetz
JC



On Mon, Nov 17, 2008 at 10:26 AM, Latcho <[EMAIL PROTECTED]> wrote:
> How to break a line of text on the optimal charachter and adding "..." if it
> doesn't fit a single lined textfield
> | I would like to break | this line of text.
> | I would like to br... |
>
> Any suggestions (AS3)
>
> Latcho
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to