# SwapDepths and LoadMovie

**URL:** <https://forum.kirupa.com/t/swapdepths-and-loadmovie/57745>\
**Category:** flash\
**Created:** [July 15, 2004, 8:40pm UTC](https://forum.kirupa.com/t/swapdepths-and-loadmovie/57745 "2004-07-15T20:40:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hey\_suburbia](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@hey\_suburbia](https://forum.kirupa.com/u/hey_suburbia)\
**Post date:** [July 15, 2004, 8:40pm UTC](https://forum.kirupa.com/t/swapdepths-and-loadmovie/57745/1 "2004-07-15T20:40:15Z")

</div>

I have a main movie with 5 buttons that launch seperate .swf’s (loadMovie).

They are draggable, but I can’t get the swapdepths to work.

Main movie button 1:

```auto
on(release){
	loadMovie("pop1.swf", 40)
}

```

Main movie button 2:

```auto
on(release){
	loadMovie("pop2.swf", 41)
}

```

popup 1:

```auto
on (press) {
	_root.pop1.startDrag();
	_level0.mydepth += 20;
	_root.pop1.swapDepths(_level0.mydepth);
}
on (release) {
	_root.pop1.stopDrag();
}

```

popup2:

```auto
on (press) {
	_root.pop1.startDrag();
	_level0.mydepth += 20;
	_root.pop2.swapDepths(_level0.mydepth);
}
on (release) {
	_root.pop2.stopDrag();
}

```

I attached my .fla’s

---

<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:** [July 16, 2004, 5:41pm UTC](https://forum.kirupa.com/t/swapdepths-and-loadmovie/57745/2 "2004-07-16T17:41:58Z")

</div>

Just wanted to add that I followed Kirupa’s and a few other tutorials, but couldn’t get it to work…

Any thoughts?

is it a \_level issue?

---

<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:** [July 16, 2004, 8:43pm UTC](https://forum.kirupa.com/t/swapdepths-and-loadmovie/57745/3 "2004-07-16T20:43:06Z")

</div>

Levels are something different as depths.  
I’ve changed the code a little, the swf are now loaded in empty mc’s

```auto
on(release){
	box1.loadMovie("pop1.swf")
}

```

and the code in pop1:

```auto
on (press) {
	this._parent.startDrag();
	_level0.mydepth += 20;
	this._parent.swapDepths(_level0.mydepth);
}
on (release) {
	this._parent.stopDrag();
}

```

scotty(-:

---

<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:** [July 16, 2004, 11:15pm UTC](https://forum.kirupa.com/t/swapdepths-and-loadmovie/57745/4 "2004-07-16T23:15:48Z")

</div>

Thank You,

Works perfect.

If anybody needs a swapdepths sample using loadmovie, download scotty’s zip file above this post.

---

<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:** [July 17, 2004, 7:41am UTC](https://forum.kirupa.com/t/swapdepths-and-loadmovie/57745/5 "2004-07-17T07:41:02Z")

</div>

welcome:thumb:

---

<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:** [July 17, 2004, 4:39pm UTC](https://forum.kirupa.com/t/swapdepths-and-loadmovie/57745/6 "2004-07-17T16:39:59Z")

</div>

the swap depth work but when you close the popups the buttons disappears.

---

<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:** [July 17, 2004, 8:48pm UTC](https://forum.kirupa.com/t/swapdepths-and-loadmovie/57745/7 "2004-07-17T20:48:47Z")

</div>

You’re right, I never looked at the close button:stunned:  
Replace the code on the button with this one

```auto
on (release) {
	this._parent._visible = 0;
}

```

scotty(-:
