Skip navigation
tropicanaclock
Currently Being Moderated

Text border wont reduce after a certain length

Jun 28, 2012 2:37 PM

Right now I'm working on a border that will expand as the text width gets larger. and to have the border have a maxium size yet still be able to enter text.

What i'm having trouble with: Once I reach a certain width, backspace dosent reduce the border anymore.

 

 

 

 

// border code

if (inputTxt.width <= 160)

{

          inputTxt.border = true;

inputTxt.autoSize = TextFieldAutoSize.LEFT

} else{

          inputTxt.border = true;

          trace("working");

          inputTxt.autoSize = TextFieldAutoSize.NONE

 

 

}

 

// backspace code

key_bksp.addEventListener(MouseEvent.CLICK, bkspClickListener);

function bkspClickListener(e:MouseEvent):void{

          inputTxt.replaceText(inputTxt.text.length-1, inputTxt.text.length,'');

          inputTxt.border =true;

 

}

 

any help would be appericated

 
Replies
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 28, 2012 4:48 PM   in reply to tropicanaclock

    unless that border code is in some function or otherwise repeatedly executes, it doens't look like anything would dynamically change the autosizing of inputTxt.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points