# If a clip is loaded, then don't load it again?

**URL:** <https://forum.kirupa.com/t/if-a-clip-is-loaded-then-dont-load-it-again/270726>\
**Category:** Uncategorized\
**Created:** [September 12, 2008, 10:04pm UTC](https://forum.kirupa.com/t/if-a-clip-is-loaded-then-dont-load-it-again/270726 "2008-09-12T22:04:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![markbeeson](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@markbeeson](https://forum.kirupa.com/u/markbeeson)\
**Post date:** [September 12, 2008, 10:04pm UTC](https://forum.kirupa.com/t/if-a-clip-is-loaded-then-dont-load-it-again/270726/1 "2008-09-12T22:04:57Z")

</div>

Hi All-

I’m having trouble with a button script my client has asked me to create. I need help on putting together a script to detect if a specific movie clip “port\_fade.swf” has already been loaded and into a container and if so don’t reload it. This clip has to load on a on(release) function. I have 8 buttons and depending on which button a visitor clicks on I need the clip to load. I don’t want to have it reload every time a button is clicked.

I found this code but it doesn’t seem to work.

function loadExternalSwf() {  
if (containerFade.thisID == “port\_fade.swf”) {  
trace(“Content already loaded - Don’t do anything.”);  
} else {  
mcl.loadClip(“port\_fade.swf”, containerFade);  
}  
}

My current button code is this:

on (release) {  
if (\_root.currMovie == undefined) {  
\_root.currMovie = “port\_fade”;  
containerFade.loadMovie(“port\_fade.swf”);  
} else if (\_root.currMovie != “port\_fade”) {  
if (containerFade.\_currentframe \>= containerFade.midframe) {  
\_root.currMovie = “port\_fade”;  
containerFade.play();  
}  
}  
}

Thank you for any assistance.
