Using a variable to loadMovie

simple question, can i use a variable to load a new .swf file? this doesn’t seem to work…

function swapMovie (newMovie) {
unloadMovie(10);
newMovie = newMovie + “.swf”;
// trace(newMovie);
loadMovie(eval(newMovie), 10);
}

thanks for any help!

This works:

_root.createEmptyMovieClip(“button”,10);
newMovie = “hex”;
newMovie = newMovie+“swf”;
button._x=50;
button._y=50;
//trace(newMovie);
loadMovie(newMovie, button);

By trial and error it seems you can load it into 10 if its given a filename:

loadMovie(“hex.swf”,10);

but this doesnt work:

loadMovie(newMovie,10);

seems you have to specify the movieclip name when dealing with variables.

Hope this helps

ahh… i see.

thanks!