Hi there…just need some help with my problem…actually Im working on quiz application.so here in I’m simplify of overall my problem…as u can see I have several TextField …my problem is
i)how to automatically setFocus on the very 1st TextInput …
ii)How to move the cursor automatically after Event Change on da 1st textfield…because every textfield has 1 for the maxChars
here;s my attempt so far…
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.display.MovieClip;
import flash.utils.getDefinitionByName;
public class Main extends MovieClip{
private var arrTxt:Array = new Array("n","a","m","e");
public function Main() {
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, init);
createTextInput();
}
private function createTextInput():void{
for(var i:Number=0;i<arrTxt.length;i++){
var txtObj:Object = getDefinitionByName("BoxTxt") as Class;
var txtInputMC:MovieClip = new txtObj();
txtInputMC.name = "INPUT_"+i;
txtInputMC.x = 60+txtInputMC.width*i;
txtInputMC.y = 200;
stage.addChild(txtInputMC);
//stage.focus = txtInputMC.inputTxt;//not to avail...
}
}
}
}
Any help are appreciated tq…