Hello,

I'm trying to restrict text input into a field so that you can only enter as much as will fit into the field and the rest gets cut off.

I was using code like

textBox.onChanged = function() {
        while (this.maxscroll>1) {
                this.text = this.text.substr(0,-1);
        }
}

This works fine as long as its just plain text. However I need to use html text so that the user can apply formatting.

If I try using

textBox.onChanged = function() {
        while (this.maxscroll>1) {
                this.htmlText = this.htmlText.substr(0,-1);
        }
}

then Flash goes into an infinite loop. I did some debugging and it looks like the value of maxscroll isn't the same for htmlText and so
removing the last character doesn't reduce maxscroll in the same way,

Anyone any cunning solutions or thoughts? I'm using Flash 8.

Cheers

Joe


Joe Cutting
Computer exhibits and installations
www.joecutting.com
96 Heslington Road, York, YO10 5BL
01904 627428
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to