ThomasJSmart
Programmer
- Sep 16, 2002
- 634
im a having a bit of difficulty with the names of vars.
i have a txt file with some vars:
total=3&name1=tom&name2=john&name3=fred
iv loaded these into the root of my movie
i have a movieclip called holder. What i want to do is duplicate the holder MC until i have the same amount of mc's as the total var so then i have
holder1
holder2
holder3
each holder mc has a text field called name, after each duplicate movie i want to asign the _root.name var to the text field in each mc.
_root.holder1.name = _root.name1
_root.holder2.name = _root.name2
_root.holder3.name = _root.name3
this works but not the way i want it to as the contents of the text file can be any amount of names...
how do i do this? what i tried is this:
for (c=1; c <= _root.total; c++)
{
duplicateMovieClip ("holder", "holder"+c, c+5);
set("_root.holder"+c+".name = _root.name+c
}
instead of making holder1 it tried to add 1 to "holder" giving a result of 1,
how do i do this the right way?
any help apreciated,
thanks,
Thomas
I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
i have a txt file with some vars:
total=3&name1=tom&name2=john&name3=fred
iv loaded these into the root of my movie
i have a movieclip called holder. What i want to do is duplicate the holder MC until i have the same amount of mc's as the total var so then i have
holder1
holder2
holder3
each holder mc has a text field called name, after each duplicate movie i want to asign the _root.name var to the text field in each mc.
_root.holder1.name = _root.name1
_root.holder2.name = _root.name2
_root.holder3.name = _root.name3
this works but not the way i want it to as the contents of the text file can be any amount of names...
how do i do this? what i tried is this:
for (c=1; c <= _root.total; c++)
{
duplicateMovieClip ("holder", "holder"+c, c+5);
set("_root.holder"+c+".name = _root.name+c
}
instead of making holder1 it tried to add 1 to "holder" giving a result of 1,
how do i do this the right way?
any help apreciated,
thanks,
Thomas
I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!