actionscript 3 - Hide a character in textField using TextFormat in as3 -
i have textfield text , need hide last character
i tried
_textfield.text = "my string"; var newtextformat:textformat = new textformat(); newtextformat.size = 0; _textfield.settextformat(newtextformat, _textfield.length-1, _textfield.length-1);
the issue last charter still visible single pixel. there way set font color transparent example
newtextformat.color = <any tranparent color>;
instead of changing size or alpha, recomend replacing text string inside of textfield blank field(" "), this:
_textfield.text = "my string"; var newstring:string=_textfield.text.replace (_textfield.text.charat (_textfield.text.length-1) , " "); _textfield.text =newstring; //now textfield text strin
if want other character, not last one, can change e.g.
_textfield.text = "my string"; var newstring:string=_textfield.text.replace (_textfield.text.charat (3) , " "); _textfield.text =newstring; //now textfield text tring
Comments
Post a Comment