# Input text in MC

**URL:** <https://forum.kirupa.com/t/input-text-in-mc/64673>\
**Category:** Uncategorized\
**Created:** [September 18, 2004, 6:36pm UTC](https://forum.kirupa.com/t/input-text-in-mc/64673 "2004-09-18T18:36:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uli](https://avatars.discourse-cdn.com/v4/letter/u/ccd318/32.png) [@Uli](https://forum.kirupa.com/u/Uli)\
**Post date:** [September 18, 2004, 6:36pm UTC](https://forum.kirupa.com/t/input-text-in-mc/64673/1 "2004-09-18T18:36:13Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 18, 2004, 6:43pm UTC](https://forum.kirupa.com/t/input-text-in-mc/64673/2 "2004-09-18T18:43:55Z")

</div>

okay by focus you mean you cant click on it and type… if this is right ill type more.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 18, 2004, 7:16pm UTC](https://forum.kirupa.com/t/input-text-in-mc/64673/3 "2004-09-18T19:16:18Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 18, 2004, 7:17pm UTC](https://forum.kirupa.com/t/input-text-in-mc/64673/4 "2004-09-18T19:17:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 18, 2004, 7:29pm UTC](https://forum.kirupa.com/t/input-text-in-mc/64673/5 "2004-09-18T19:29:10Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 18, 2004, 7:46pm UTC](https://forum.kirupa.com/t/input-text-in-mc/64673/6 "2004-09-18T19:46:24Z")

</div>

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??

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 18, 2004, 7:53pm UTC](https://forum.kirupa.com/t/input-text-in-mc/64673/7 "2004-09-18T19:53:54Z")

</div>

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:
