# Transitions Between External SWFs Tutorial Question

**URL:** <https://forum.kirupa.com/t/transitions-between-external-swfs-tutorial-question/183182>\
**Category:** flash\
**Created:** [March 24, 2006, 12:57pm UTC](https://forum.kirupa.com/t/transitions-between-external-swfs-tutorial-question/183182 "2006-03-24T12:57:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adfox](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@adfox](https://forum.kirupa.com/u/adfox)\
**Post date:** [March 24, 2006, 12:57pm UTC](https://forum.kirupa.com/t/transitions-between-external-swfs-tutorial-question/183182/1 "2006-03-24T12:57:43Z")

</div>

Hi,

After following the [Transitions Between External SWFs](http://www.kirupa.com/developer/mx2004/transitions.htm) Tutorial

Does anyone know how I can make this button work if it is not in the main swf? I have loaded a swf in automatically and want to make a button from within the loaded swf to load another swf.

Here is the button code…

```auto
on (release) {
	if (_root.currMovie == undefined) {
		_root.currMovie = "myWay";
		container.loadMovie("myWay.swf");
	} else if (_root.currMovie != "myWay") {
		if (container._currentframe>= container.midframe) {
			_root.currMovie = "myWay";
			container.play();
		}
	}
}

```

Thanks.

---

<div class="post-metadata">

**Author:** ![jasarius](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@jasarius](https://forum.kirupa.com/u/jasarius)\
**Post date:** [March 24, 2006, 11:37pm UTC](https://forum.kirupa.com/t/transitions-between-external-swfs-tutorial-question/183182/2 "2006-03-24T23:37:31Z")

</div>

Don’t quote me on this because I’m far from an AS expert, but if you have a button on your loaded .swf, you don’t want to have it load another external .swf to the \_root, I think you would want to load it something like this:

```auto
this.currMovie == undefined

```

Change your \_root to ‘this.’ That way you just replace the current movie with another instead of trying to load it onto the main stage.

In fact, I think your button on inside the external clip can be fairly simple like this:

```auto
on (release) {
	//load Movie Behavior
	if (this == Number(this)) {
		loadMovieNum("yourNewClip.swf", this);
	} else {
		this.loadMovie("yourNewClip.swf");
	}
	//End Behavior
}

```

This would be done on the button itself simply using the built-in behaviors that Flash has. If you have the same buttons as you do on the main stage, I wouldn’t even bother having two buttons doing the same thing though.

I’m not even sure if any of that made sense, but play around with it until someone who knows exactly what they are talking about comes by and corrects me. :run:
