Being blind

Probably just not seeing the blindingly obvious here. Chucking up an error on the loadMovie line, whenever I add in the “+i” bit to load up each image. Anyone see what the problem is here? [AS]index=10;
for (i=2; i<8; i=i+1) {
thumbnail.duplicateMovieClip(“tn_” +i, i);
this[“tn_”+i].x = index;
this["tn
"+i].y = 50;
this["tn
"+i].loadMovie(“thumbs/tn_gallery_”+i".jpg", 0);
index=index+60
}

stop();[/AS]

What kind of error?[AS]index=10;
for (i=2; i<8; i++) {
var tn = thumbnail.duplicateMovieClip(“tn_” +i, i);
tn._x = index;
tn.y = 50;
var fileToLoad = "thumbs/tn_gallery
"+i".jpg";
trace (fileToLoad);
tn.loadMovie(fileToLoad, 0);
index=index+60
}
stop();[/AS]Does this trace what you expect?

Oups, OK, there’s a typo in your code: there’s a + missing between i and “.jpg”

"thumbs/tn_gallery_"+i**+**".jpg";

pom :slight_smile:

When I use [AS]index=10;
for (i=2; i<8; i=i+1) {
thumbnail.duplicateMovieClip(“tn_” +i, i);
this[“tn_”+i].x = index;
this["tn
"+i].y = 50;
this["tn
"+i].loadMovie(“thumbs/tn_gallery_1.jpg”, 0);
index=index+60
}

stop();[/AS] it works fine and loads the same image into each movie. So it duplicates and creates everything without a problem.

Soon as I add “+i”… [AS]index=10;
for (i=2; i<8; i=i+1) {
thumbnail.duplicateMovieClip(“tn_” +i, i);
this[“tn_”+i].x = index;
this["tn
"+i].y = 50;
this["tn
"+i].loadMovie(“thumbs/tn_gallery_”+i".jpg", 0);
index=index+60
}

stop();[/AS] I get this:

Scene=Scene 1, Layer=ActionScript, Frame=3: Line 6: ‘)’ or ‘,’ expected
this[“tn_”+i].loadMovie(“thumbs/tn_gallery_”+i".jpg", 0);

Scene=Scene 1, Layer=ActionScript, Frame=3: Line 8: Unexpected ‘}’ encountered
}

Ahhh… Thanks. :slight_smile: Knew it was something stupid. Curses to typos. :slight_smile:

Yeah, well you curse them, while I curse Flash’s error messages :evil:

They don’t help. :slight_smile: I was thinking I’d left out a bracket somewhere… :sigh:

Anyway, cheers Ilyas. :slight_smile: