shortly
07-15-2005, 01:03 PM
hi...
i've go the following code in a script i'm making. and i know there must be a more efficient way of doing the same thing. i just can't think of how.
this code is being called as part of a listener which is tracking a bunch of jpgs that are loading into MCs. on certain MCs i want to add some text dynamically and have that text repeat over 5 MCs. after each group of 5 i increase a counter that chooses a new variable to load into the dynamic text (that's the 'l' counter in the code below).
any thoughts?
thanks,
short.
oh, the 'k' was a counter for a loop to dynamically add MCs for the jpgs to load into... in case that helps!
if (k>=2 && k<=6){
initTxt();
if(k==6){
l++;
}
}
if (k>=7 && k<=11){
initTxt();
if(k==11){
l++;
}
}
if (k>=12 && k<=16){
initTxt();
if(k==16){
l++;
}
}
if (k>=16 && k<=21){
initTxt();
if(k==21){
l++;
}
}
if (k>=21 && k<=26){
initTxt();
if(k==26){
l++;
}
}
if (k>=26 && k<=31){
initTxt();
if(k==31){
l++;
}
}
if (k>=31 && k<=36){
initTxt();
if(k==36){
l++;
}
}
if (k>=36 && k<=41){
initTxt();
if(k==41){
l++;
}
}
if (k>=41 && k<=46){
initTxt();
if(k==46){
l++;
}
}
if (k>=46 && k<=51){
initTxt();
if(k==51){
l++;
}
}
i've go the following code in a script i'm making. and i know there must be a more efficient way of doing the same thing. i just can't think of how.
this code is being called as part of a listener which is tracking a bunch of jpgs that are loading into MCs. on certain MCs i want to add some text dynamically and have that text repeat over 5 MCs. after each group of 5 i increase a counter that chooses a new variable to load into the dynamic text (that's the 'l' counter in the code below).
any thoughts?
thanks,
short.
oh, the 'k' was a counter for a loop to dynamically add MCs for the jpgs to load into... in case that helps!
if (k>=2 && k<=6){
initTxt();
if(k==6){
l++;
}
}
if (k>=7 && k<=11){
initTxt();
if(k==11){
l++;
}
}
if (k>=12 && k<=16){
initTxt();
if(k==16){
l++;
}
}
if (k>=16 && k<=21){
initTxt();
if(k==21){
l++;
}
}
if (k>=21 && k<=26){
initTxt();
if(k==26){
l++;
}
}
if (k>=26 && k<=31){
initTxt();
if(k==31){
l++;
}
}
if (k>=31 && k<=36){
initTxt();
if(k==36){
l++;
}
}
if (k>=36 && k<=41){
initTxt();
if(k==41){
l++;
}
}
if (k>=41 && k<=46){
initTxt();
if(k==46){
l++;
}
}
if (k>=46 && k<=51){
initTxt();
if(k==51){
l++;
}
}