theoceanfrog
03-30-2003, 07:34 PM
hey gang
i am having some issue in passing variables from one .swf to another that is loaded into _level99. because they are all generated dynamically in a numerical row (i.e. g000, g001, g002, etc) but the row might at different times be of different lengths (one set may only have two entries (g000 and g001) and another might have 6 ro 7 i am using a for loop to pass them. when traced from within the for loop everything works fine, but when called from within _level99 (after the for loop has run) they no longer exist.
any help on making these variables persistent?
here is the script:
for (g=0; g<=7; g++) {
gnum=("000"+g).substr(-3);//generate the 3-number
if (_root["g"+_root.gnum] != undefined) {
_level99["g"+_root.gnum] = _root["g"+_root.gnum];
trace(_level99["g"+_root.gnum] +" passed to _level99, as g" + gnum);
} else {
_level99["g"+_root.gnum] = undefined;
}
for (sg=0; sg<=12; sg++) {
sgnum=("000"+sg).substr(-3);//generate the 3-number
if (_root[eval("_root.g"+gnum)+_root.sgnum] != undefined) {
_level99[eval("_root.g"+gnum)+_root.sgnum] = _root[eval("_root.g"+gnum)+_root.sgnum];
trace(" "+_level99[eval("_root.g"+gnum)+_root.sgnum] +" passed to _level99, as "+eval("_root.g"+gnum) + sgnum);
} else {
_level99["g"+_root.sgnum] = undefined;
}
}
}
any help will be much appreciated
thanks
i am having some issue in passing variables from one .swf to another that is loaded into _level99. because they are all generated dynamically in a numerical row (i.e. g000, g001, g002, etc) but the row might at different times be of different lengths (one set may only have two entries (g000 and g001) and another might have 6 ro 7 i am using a for loop to pass them. when traced from within the for loop everything works fine, but when called from within _level99 (after the for loop has run) they no longer exist.
any help on making these variables persistent?
here is the script:
for (g=0; g<=7; g++) {
gnum=("000"+g).substr(-3);//generate the 3-number
if (_root["g"+_root.gnum] != undefined) {
_level99["g"+_root.gnum] = _root["g"+_root.gnum];
trace(_level99["g"+_root.gnum] +" passed to _level99, as g" + gnum);
} else {
_level99["g"+_root.gnum] = undefined;
}
for (sg=0; sg<=12; sg++) {
sgnum=("000"+sg).substr(-3);//generate the 3-number
if (_root[eval("_root.g"+gnum)+_root.sgnum] != undefined) {
_level99[eval("_root.g"+gnum)+_root.sgnum] = _root[eval("_root.g"+gnum)+_root.sgnum];
trace(" "+_level99[eval("_root.g"+gnum)+_root.sgnum] +" passed to _level99, as "+eval("_root.g"+gnum) + sgnum);
} else {
_level99["g"+_root.sgnum] = undefined;
}
}
}
any help will be much appreciated
thanks