# Swap to different instances

**URL:** <https://forum.kirupa.com/t/swap-to-different-instances/28575>\
**Category:** flash\
**Created:** [August 15, 2003, 6:31am UTC](https://forum.kirupa.com/t/swap-to-different-instances/28575 "2003-08-15T06:31:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![amerifax](https://avatars.discourse-cdn.com/v4/letter/a/839c29/32.png) [@amerifax](https://forum.kirupa.com/u/amerifax)\
**Post date:** [August 15, 2003, 6:31am UTC](https://forum.kirupa.com/t/swap-to-different-instances/28575/1 "2003-08-15T06:31:04Z")

</div>

I load, with the help of the form, the following:

\_root.loader.loadMovie(“Front\_Page\_Ad2.swf”);  
stop();

It loads to my instance called “contents”. I than do the following:  
on (release) {  
\_root.contents.loadMovie(“Pad\_Wis.swf”);  
}

As you can imagine it goes over the top of “Front\_Page\_Ad2.swf"  
How can I swap out the movies to the instance “contents”? I have several movies that swap out by different buttons.

Bob

---

<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:** [August 15, 2003, 12:51pm UTC](https://forum.kirupa.com/t/swap-to-different-instances/28575/2 "2003-08-15T12:51:48Z")

</div>

This link should help you out,

[http://www.kirupa.com/developer/actionscript/swapdepth.htm](http://www.kirupa.com/developer/actionscript/swapdepth.htm)

Regards,  
Viru.

---

<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:** [August 15, 2003, 5:25pm UTC](https://forum.kirupa.com/t/swap-to-different-instances/28575/3 "2003-08-15T17:25:10Z")

</div>

Becouse they are transperant, I was hoping that there was a command that would remove what was there before it is placed on the area of the target text area.

Bob

---

<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:** [August 15, 2003, 5:26pm UTC](https://forum.kirupa.com/t/swap-to-different-instances/28575/4 "2003-08-15T17:26:56Z")

</div>

If you totally want to remove the swf so that it cant be seen on the stage then use unloadMovie(“movie.swf”); Just like using loadMovie, only it does the opposite.

Regards,  
Viru.

---

<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:** [August 15, 2003, 5:29pm UTC](https://forum.kirupa.com/t/swap-to-different-instances/28575/5 "2003-08-15T17:29:25Z")

</div>

Thank you. And thanks for the fast responce.

Bob

---

<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:** [August 15, 2003, 7:42pm UTC](https://forum.kirupa.com/t/swap-to-different-instances/28575/6 "2003-08-15T19:42:46Z")

</div>

Since I use the following I will not know the name of the currant movie:

on (release) {  
\_root.product.loadMovie(“Pad\_Lead.swf”);  
}

Is there a way to remove away movie that is on the instant “product”?

Bob

---

<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:** [August 15, 2003, 7:45pm UTC](https://forum.kirupa.com/t/swap-to-different-instances/28575/7 "2003-08-15T19:45:53Z")

</div>

Hey,

If you do  
[AS]  
on(release) {  
\_root.product.loadMovie(“a.swf”);  
}  
[/AS]

Then another button you have  
[AS]  
on(release) {  
\_root.product.loadMovie(“b.swf”);  
}  
[/AS]

Then its my belief that b.swf will just replace a.swf. i.e Flash will automatically unload a.swf then load b.swf in after it.

Regards,  
Viru.
