Groups | Blog | Home
all groups > flash actionscript > april 2005 >

flash actionscript : Referencing stage members with variables?



reidman24
4/22/2005 9:47:38 PM
I'll try to keep this simple. Lets say I have a text field that I generated
with the following code:

var fooBar = "txtWooga";
createTextField(fooBar, 10, 0, 0, 100, 50);

This would create a text field called txtWooga. Now, how could I reference
this text field using the fooBar variable? For example, say I wanted to change
the x position. This code would work:

_root.txtWooga._x = 60;

But I want to use the fooBar variable. I've tried this with no luck:

_root.(fooBar)._x = 60;

Any ideas? I would search on Google or these forums for answers, but I don't
even know how to phrase this kind of problem succinctly...
kglad
4/22/2005 10:24:52 PM
reidman24
4/22/2005 10:28:35 PM
kglad
4/23/2005 6:25:14 AM
AddThis Social Bookmark Button