Load Movie - Please Help

Hello!

In the stage of the site I am building there’s a menu with 5 different buttons. Each one of these buttons loads an external movie (.swf) into a target in the stage.

Everything works well, but if I press the same button more than one time in a row it loads the same movie again and again. I mean, suppose I press Button 1. That loads Movie 1. If I press Button 1 again it loads Movie 1 another time, even though Movie 1 was already loaded.

I guess what I am trying to ask is: how can I write I script to check if a certain movie is already loaded before loading it again? How can I write something like the following script in Flash?

On Release
If “Movie 1” is already loaded
Then Do Nothing
Else
Load “Movie 1”

Thank you!

Hmm, so you don’t want it to load more than once if already loaded. We have to set some variables here so flash can check back if it’s already loaded or not like so: EDIT


on (release) {
        // If the current movie is not home:
        if (currentLoaded != "Home") {
                // Then set the variable to home:
                currentLoaded = "Home";
                // And load home:
                loadMovie ("Home.swf", 1);
                // Else:
        } else {
                // Just keep whatever is loaded to itself:
                currentLoaded = currentLoaded;
        }
}

Put this on each button and replace Home with whatever the button loads (e.g. if it’s about change all to about and about.swf)…