# Unload/Load New Movie Clip Problem

**URL:** https://forum.kirupa.com/t/unload-load-new-movie-clip-problem/254204
**Category:** flash
**Created:** [March 9, 2008, 5:26pm UTC](https://forum.kirupa.com/t/unload-load-new-movie-clip-problem/254204 "2008-03-09T17:26:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kagoolsby](https://avatars.discourse-cdn.com/v4/letter/k/74df32/32.png) [@kagoolsby](https://forum.kirupa.com/u/kagoolsby)
#### Post date: [March 9, 2008, 5:26pm UTC](https://forum.kirupa.com/t/unload-load-new-movie-clip-problem/254204/1 "2008-03-09T17:26:51Z")

</div>

I have a quick question to see if I am missing something or just generally not coding it correctly.

Basically, I have a main movie clip on the time where I load external SWFs into.  
I have one opening SWF titled “front\_page.swf” that is loaded upon entry of the site.  
Basically this animation stops at frame 24 as that is the “intro” section of the animation.

I have nav bars at the top that when clicked should cause “front\_page.swf” to play starting at frame 25 until end. Consider this the “outro” animation.

Now, all that is well and good, but I want a NEW .swf to be loaded into the Movie Clip after “front\_page.swf” is finished playing.

Here is some code that I attempted to make this happen, but has yet to work.

Frame 1 of “front\_page.swf”:

> \_global.isplaying = 1;

then at the last Frame of “front\_page.swf”:

> \_global.isplaying = 0;

Now, on the button in the main movie timeline where “front\_page.swf” is loaded into:

> //this is where i attempt to load the new .swf into the movie clip with the instance name of “main\_page” after it reaches a point where the previous movie clip, “front\_page.swf” has declared the variable as being 0.

on (release) {  
\_root.main\_page.gotoAndPlay (“close”);  
if (\_global.isplaying = 0) {  
loader.loadClip (“galleries/gallery.swf”, main\_page);  
}  
}

Does anyone see a problem with how I am attempting this? Is there an easier way?  
Clearly I am doing something incorrectly as it is not functioning.  
It makes sense in my head but I think the Actionscript is processing it too fast or something.  
I have also attempted to use the getBytesLoaded and getBytesTotal commands in order to see when “front\_page.swf” reaches the last frame… but that isn’t functioning correctly, either.

I spent probably 5 hours trying to figure this out last night and completely spent and at a loss on how to fix this.

Any help would be greatly appreciated!
