ActionScript 3 将选择设置为文本字段

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 将选择设置为文本字段相关的知识,希望对你有一定的参考价值。

// To set selection a textfield, use the following;

var _textInput1:TextField = new TextField();
_textInput1.addEventListener(Event.CHANGE, handleTextChange, false, 0, true);

function handleTextChange(event:Event):void {
			
	switch(event.target){				
		case _textInput1:
			trace("input 1");
			if(_textInput1.text.length == 2) {
				stage.focus = _textInput2;
				_textInput2.setSelection(0, _textInput2.text.length); // or second param equals 0 -> 0,0
			}
		break;
		}
	}

以上是关于ActionScript 3 将选择设置为文本字段的主要内容,如果未能解决你的问题,请参考以下文章