# Load Movie - Please Help

**URL:** https://forum.kirupa.com/t/load-movie-please-help/42980
**Category:** flash
**Created:** [February 16, 2004, 11:20pm UTC](https://forum.kirupa.com/t/load-movie-please-help/42980 "2004-02-16T23:20:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![freiredelima](https://avatars.discourse-cdn.com/v4/letter/f/7c8e57/32.png) [@freiredelima](https://forum.kirupa.com/u/freiredelima)
#### Post date: [February 16, 2004, 11:20pm UTC](https://forum.kirupa.com/t/load-movie-please-help/42980/1 "2004-02-16T23:20:33Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 16, 2004, 11:31pm UTC](https://forum.kirupa.com/t/load-movie-please-help/42980/2 "2004-02-16T23:31:31Z")

</div>

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_**

```auto

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)…
