PDA

View Full Version : dynamic mc prob


jockmahon
10-02-2007, 10:40 AM
Hi
i have an array of mc's created at runtime, each mc has textin puts after the mc is created i want to set the text of the inputs to a value

mcArray[i].time1TextInput.text = 1;

the value seams to be get set ie if i do a trace on
mcArray[i].time1TextInput.text i get "1"

but the mc is not displaying / updating the visual i have tryed

redraw on the input but to no avail

any ideas :o

seejee
10-02-2007, 11:28 AM
when you get any string value as mc name or variable name. when you get back his value as mcname or var name then you use eval() function for the changing of string type. try to use below code and let me know it is workable for you or not:


mcArray[i].time1TextInput.text = 1;

//trace mcArray[i].time1TextInput.text
trace(eval(mcArray[i]+".time1TextInput").text);

jockmahon
10-02-2007, 11:46 AM
well this is not really the problem cause if i do

trace(mcArray[i].time1TextInput.text),
i get "1" printed in the output

its just the textinput does not display this

jockmahon
10-02-2007, 11:48 AM
here is the creation of the mc's

for(var i = 0; i < 5; i++)
{

mcArray[i] = this.attachMovie("marTimings", "marTimings_mc"+i, this.getNextHighestDepth(), {_x:10, _y:180 + (i * 60)});
}