setFocus is driving me crazy! please help!

Hi,

How the **** do you set the focus on a dynamicly created input field inside a dynamicly created MC???
I’m using mx2004pro btw…

ps: i can’t use the Selection.setFocus(“TF”) here cause i don’t have no 1st frame where to write that down…

Please help i’m stuck at this for days !!!

I wish I could help you, I know the feeling of being stuck (I was stuck on a problem for 2 years :huh:!!!)

peace

_root.mc1.text1.selection.setFocus();

nope, i tried that…
in fact here’s what i did


this.onEnterFrame = function() {
	if (this.myTF !== undefined) {
	_level0.someMC.sometrace = "OK";
	_level0.someMC.MCA1.MCB1.MCC1.myTF.Selection.setFocus();
		delete this.onEnterFrame;
	}
};

and my sometrace traces OK so the “if” works…
any other idea??

i don’t get it, i don’t have any cursor blinking, if i try to select the text it gets selected with a black block not entierly… this is just too weird

I think myTF is a text field so check,
if (this.myTF.text !=null){
//put code here
}

publish your file so I could get an Idea…

can’t be cause my tracing displays “ok” as i asked for… but thanks :slight_smile:

can’t really publish it cause enormous… sorry…