Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : set text input text in movie clip


JCerrone
5/4/2004 8:54:58 PM
I am attaching a movie clip to the main timeline. The movie clip linkage name
is addBox. I'd like to set the value in a text input component called lname.
I'm doing something like this but it's not working. Can anyone lend a hand?

_root.attachMovie("addBox", "myAddBox", 10);
myAddBox._x = 100;
myAddBox._y = 100;
myAddBox.lname.text = "Last Name";

I see the text input box but it doesn't have the value of "Last Name".


N Rohler
5/4/2004 9:10:04 PM
I think the issue has to do with initiating the component. Without getting
really in-depth, the easiest workaround is:
myAddBox.attachMovie("TextInput", "lname", 11);
myAddBox.lname.text = "Last Name";

That seems to fix the issue.
JCerrone
5/5/2004 2:28:17 AM
mandingo
5/5/2004 4:28:27 AM
Hi,

I just used your code exactly as you had it... created a movieClip with
linkage identifier of "addBox" and inside that movieClip a dynamic textField
with an instance name of " lname ".

Your code worked exactly as would be expected.

If it isn't displaying " Last Name " in the text field, then the only thing I
can think of based on the code provided is that something else is also loading
at the same DEPTH as the text field. This would cause the text not to appear.

Have a look for something like that. Hope it helps, your code is fine
cheers,
JCerrone
5/5/2004 2:56:50 PM
AddThis Social Bookmark Button