I’ve got this code I’m trying to update from a game. Basically what the problem is, is trying to get bullets between each word that is shown. That is accomplished you’ll see in the last loop at the bottom. (words are being pulled from an array as you’ll see). The only thing is to not have a bullet after the last word. So I created an if statement to trigger if the last word shown is even with the lettercount of the word. It doesn’t trigger.
I can provide an fla (via ftp) if anyone needs more info. Thx!!
Here’s the swf to see how it works (choose boy)
//
//
//lettercount = babyname.length-1;
// Take name and spread it out to fill the array nameindexed
//String.charAt
//indexname();
//
countdown = 0;
wordfade.gotoAndStop(babygender);
//
//
//
//
wordfadename.gotoAndStop(babygender);
printzone.wordfadenameprint.gotoAndStop(babygender);
capitalizer();
wordfadename.babyname = babyoriginalnameversion;
wordfadeadj.gotoAndStop(babygender);
printzone.wordfadeadjprint.gotoAndStop(babygender);
//
bckground.gotoAndStop(babygender);
printzone.printzone.gotoAndStop(babygender);
bckground.slide.gotoAndStop(1);
backgroundcounter = 1;
backgroundlimit = 5;
//
wordfadeadj.adjwords = "";
//
for (i=1; i<27; i++) {
usedwords* = 0;
}
//
if (lettercount == 1) {
wordfadeadj.adjwords = " ";
}
if (lettercount == 0) {
i = 1;
usedwords[nameindexednmbr*]++;
if (usedwords[nameindexednmbr*]>3) {
usedwords[nameindexednmbr*] = 1;
}
wordfadeadj.adjwords = adjective[babygender][nameindexednmbr*][usedwords[nameindexednmbr*]];
} else {
for (i=1; i<lettercount+2; i++) {
usedwords[nameindexednmbr*]++;
if (usedwords[nameindexednmbr*]>3) {
usedwords[nameindexednmbr*] = 1;
}
///start of my fix
//this doesn't even trace out
if ([usedwords[nameindexednmbr*]] == lettercount+1){
trace("this is the last word");
}
trace([usedwords[nameindexednmbr*]]);
trace(lettercount+1);
/////////end of my fix
wordfadeadj.adjwords = wordfadeadj.adjwords+adjective[babygender][nameindexednmbr*][usedwords[nameindexednmbr*]];
if ((i/6) == Math.floor(i/6)) {
// if i is evenly divisible by 5 then i=5/10/15/20/25 or 30, which means we're at the end of a line
// so we add a lf, otherwise add a space
wordfadeadj.adjwords = wordfadeadj.adjwords+"
";
}
else {
wordfadeadj.adjwords = wordfadeadj.adjwords+" • ";
}
}
}