Copy link to clipboard
Copied
Hi,
In my flash had the following code.
import flash.events.TextEvent;
tf.addEventListener(TextEvent.TEXT_INPUT, tfHandler);
function tfHandler(e:TextEvent):void{
trace(e.target.text.length);
if(e.target.text.length == 2){
e.target.appendText("-");
stage.focus = tf;
tf.setSelection(tf.text.length,tf.text.length);
}
}
Like this How to do in AS2.?
Thanks with,
Viswa
Copy link to clipboard
Copied
Use:
tf.onChanged = function(){
if(tf.length == 3){
tf.text += "-";
Selection.setSelection(tf.text.length, tf.text.length);
}
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now