# Stop re-loading an already loaded movie

**URL:** <https://forum.kirupa.com/t/stop-re-loading-an-already-loaded-movie/35106>\
**Category:** Uncategorized\
**Created:** [November 10, 2003, 5:08pm UTC](https://forum.kirupa.com/t/stop-re-loading-an-already-loaded-movie/35106 "2003-11-10T17:08:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jondj24](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jondj24](https://forum.kirupa.com/u/jondj24)\
**Post date:** [November 10, 2003, 5:08pm UTC](https://forum.kirupa.com/t/stop-re-loading-an-already-loaded-movie/35106/1 "2003-11-10T17:08:56Z")

</div>

Is there a script that can cancel out re-loading a loaded .swf? i have 4 buttons which load 4 different .swfs, so when you click on button one, movie one loads, but if the user clicks on button one again the movie re-loads again…

how can i stop this so that it recognizes that that movie is already open?

thanks,  
jondj24

---

<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:** [November 10, 2003, 5:25pm UTC](https://forum.kirupa.com/t/stop-re-loading-an-already-loaded-movie/35106/2 "2003-11-10T17:25:25Z")

</div>

quickest way would be to throw in an IF statement to check if the movie is loaded each time you press the button. if the movie is not loaded, load it, if it is loaded, just do the other actions.

---

<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:** [November 10, 2003, 6:09pm UTC](https://forum.kirupa.com/t/stop-re-loading-an-already-loaded-movie/35106/3 "2003-11-10T18:09:19Z")

</div>

Use a variable to store the current loaded swf. Then run an if statemen to compare that value with the value of the button pressed.

---

<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:** [November 10, 2003, 9:34pm UTC](https://forum.kirupa.com/t/stop-re-loading-an-already-loaded-movie/35106/4 "2003-11-10T21:34:35Z")

</div>

hi,  
when you load the movie set a variable to true and add an if statements to each of your buttons (where each button loads a different movie). you will require a variable for each movie and the buttons must set the appropriate variables to true or false.  
something like this:

on (release){  
if (not(loaded)) {  
loadMovie(“movie1.swf”, this);  
loaded = true;  
}

}

hope this helps!
