View Full Version : input text in MC
Uli
September 18th, 2004, 02:36 PM
Hello,
I have a problem with an input text created dynamicly into a MC that is into a MC that is into a MC (...)
So it's, let's say:
_root.myclipA.myclipB.myclipC.myinputtext
now as my input text isn't on _root, i can't get focus on it (i can never add any text).
How can i do to be able to input some text in that textfield? It cannot be moved elsewhere because i drag myclipC when i press myclipB...
any ideas?
Brandon?
September 18th, 2004, 02:43 PM
okay by focus you mean you cant click on it and type... if this is right ill type more.
Uli
September 18th, 2004, 03:16 PM
Yes exactly..
I could read we can set the focus on the textfield using Selection.setFocus("myTF")
so i added this to the 1st frame
_parent.onEnterFrame = function() {
Selection.setFocus("myTF");
};
But it doesnt work much..
Brandon?
September 18th, 2004, 03:17 PM
i dont know but you could just put the btn in the back ground of the text box to make it easier for the on press... wait i think it would still go though not sure ive done it but i did it the long way make a btn hit test that goes around the input box
Uli
September 18th, 2004, 03:29 PM
That's not exactly my problem:
as the textfield is into many MCs, the focus isn't set on the textfield.
Now to make the focus on that TF, i use Selection.setFocus("myTF"); which seems to set some focus on the inital text of my TF (something like "Type Here") as it's selected but i still can't change or add more text..
Uli
September 18th, 2004, 03:46 PM
I added a variable to my dynamicly created textfield:
_root.myclipA.myclipB.myclipC.myinputtext.variable = "somevar"
in myClipC i added that to the 1st frame:
this.onEnterFrame = function(){
Selection.setFocus("somevar")}
still won't work.. what am i doing wrong??
Uli
September 18th, 2004, 03:53 PM
ahh i finally have it!!
it was setfocus("TF") and not Selection.setfocus("TF")..
:)
added: for some reason it only works if i add on _root
_root.onEnterFrame = function() {
heh = Selection.getFocus();
};
oh well :red:
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.