Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing a textfield variable dynamically

Status
Not open for further replies.

ticke

Technical User
May 1, 2003
65
US
It can be done right?

Basically, i have 1 movieclip with a textfield it in. The textfield doesnt have a variable.

What I want to do is from a frame, add an action that generate a variable for that text field.

Thanks in advance for your help.
 
In Flash MX you would have to name the textfield instance within the mc. So the path to the textfield from the root would be something like _root.mc1.textfield1. Then all you have to is write _root.mc1.textfield1.variable=X. X being the name of the variable you want to assign to your textfield.
 
Ummmmmh! I could be wrong, but don't think you can dynamically set a textfield's variable that way. You could trace the variable's name using the "variable" property (trace(_root.mc1.textfield1.variable);), but you can't set one like that!

Regards,

cubalibre2.gif
 
why do you need to give the textfield a variable in the middle of a movie?

you could set the variable from the beginning without calling upon it til necessary

OR

you could have 'textfield1' and then swap it out with 'textfield2' (with included variable which you set in the properties panel) at the frame necessary.
 
The reason why is because i want to try to create a dynamic menu. When the user clicks a button, it will attach a movie called sub which checks the value (variable) that button passes. It will then duplicate the number of drop-down. With different mc, I need to have different variable for the text field. Then from a database, i create a file via Vignette with multiple variables for building names and add it to these duplicated mc.

Just want to see if it was possible.

If i can't change the variable dynamically, guess I have to do createTextField and do it via that route.

Thanks anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top