Random Movie Picker?

hello everyone

so i am just trying to have a random movie play everytime someone comes to the website…and as usual i am trying to cobble it all together from bits of actionscript that worked in so other sitatuation which was similar but of course different in one particular and deal-breaking way…

everytime the site is loaded or the frame visited i want it to pick a movie from a choice of ten - check it wasn’t the same as before and then when that movie is finished pick a new one…

the code i have right now is this…

myMovie = new Array();
myMovie[0] = {name:"headache.swf"};
myMovie[1] = {name:"reflux.swf"};
myMovie[2] = {name:"sports.swf"};

function playMovie(MovieNum) {
    this.MovieNum = MovieNum;
	headache.gotoAndPlay(2);
    };

function selectNextMovie() {
    nextMovie = random(myMovie.length);
    if (nextMovie != oldMovie) {
        playMovie(nextMovie);
        oldMovie = nextMovie;
    } else {
        selectNextMovie();
    }
}

where it says ‘headache’ is where i want to put the variable that corresponds to the movie instance i want to target - taken from the array…

i’m kinda lost at the moment - i could achieve the same result by making lots of different frames and using this ‘choice’ thing that i have seen but i want to try do it economically…

any help people?

thanks,
sandy

:slight_smile: