# Problem with Transitions between external SWFs

**URL:** https://forum.kirupa.com/t/problem-with-transitions-between-external-swfs/120233
**Category:** Uncategorized
**Created:** [August 22, 2004, 7:05am UTC](https://forum.kirupa.com/t/problem-with-transitions-between-external-swfs/120233 "2004-08-22T07:05:11Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![demonqueller](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@demonqueller](https://forum.kirupa.com/u/demonqueller)
#### Post date: [August 22, 2004, 7:05am UTC](https://forum.kirupa.com/t/problem-with-transitions-between-external-swfs/120233/1 "2004-08-22T07:05:11Z")

</div>

Hello, everyone,

I’ve been using [Kirupa.com](http://Kirupa.com)’s tutorial to “build transitions between external swfs,” and I’m hitting a wall. Maybe someone can help me.

Here is a summary of the situation. I’m using Flash MX 2004. I have a main file called Main\_En.swf, which contains the empty movie clip container (\_EN is for English, because I’ll have multiple languages eventually). Upon loading, Main\_En.swf calls Welcome\_EN.swf into the container. So far, no problems.

Main\_EN.swf contains a movie clip symbol named “navigation,” inside which are the buttons that will call the other swfs (Links\_EN.swf, Stories\_EN.swf, etc.). That’s the rub: The swfs won’t load. I thought maybe it was because of the individual swf’s pre-loader code (also made from one of [Kirupa.com](http://Kirupa.com)’s tutorial) but I tried without it and the movies still failed to load.

Here is the Action Script associated with one of the buttons. All I did was copy/paste Kirupa’s code, then changed the file names, but maybe someone will spot an error. (By the way, is it OK to combine those rollOver/ rollOut commands? It seems repetitive to write it out all the time. …)

//Loads movie  
on (release) {  
if (\_root.currMovie == undefined) {  
\_root.currMovie = “Links\_EN”;  
container.loadMovie(“Links\_EN.swf”);  
} else if (\_root.currMovie != “Links\_EN”) {  
if (container.\_currentframe \>= container.midframe) {  
\_root.currMovie = “Links\_EN”;  
container.play();  
}  
}  
}  
//Button Animation  
on (rollOver) {  
tellTarget ("\_root.Yin-Navigation.Yin-Links") {  
gotoAndPlay(“Up”);  
}  
}  
on (rollOut) {  
tellTarget ("\_root.Yin-Navigation.Yin-Links") {  
gotoAndPlay(“Down”);  
}  
}  
on (rollOver) {  
tellTarget ("\_root.Yin-Navigation.Genie-Links") {  
gotoAndPlay(“Up”);  
}  
}  
on (rollOut) {  
tellTarget ("\_root.Yin-Navigation.Genie-Links") {  
gotoAndPlay(“Down”);  
}  
}  
on (rollOver) {  
tellTarget ("\_root.Katana-1.Flare-1") {  
gotoAndPlay(“Go”);  
}  
}

The “Links\_EN” file has this code on its first frame:  
midframe = 12;  
bytes\_loaded = Math.round(this.getBytesLoaded());  
bytes\_total = Math.round(this.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
this.loadBar.\_width = getPercent_100;  
this.loadText = Math.round(getPercent_100)+"%";  
if (bytes\_loaded == bytes\_total) {  
this.gotoAndPlay(3);  
}

This code is at the midframe:  
stop();

And this code is on the last frame:  
\_root.container.loadMovie(\_root.currMovie+".swf")

Well, I hope you’re not too cross-eyed by now. Thanks to anyone who chips in. I appreciate your time.

---

<div class="post-metadata">

### Author: ![Voetsjoeba](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@Voetsjoeba](https://forum.kirupa.com/u/Voetsjoeba)
#### Post date: [August 22, 2004, 9:18am UTC](https://forum.kirupa.com/t/problem-with-transitions-between-external-swfs/120233/2 "2004-08-22T09:18:39Z")

</div>

Are you sure you gave the container movieclip the instance name ‘container’ ? Also, are the buttons on the main timeline ? If not, then you’ll have to adjust the path to the container movieclip.

---

<div class="post-metadata">

### Author: ![demonqueller](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@demonqueller](https://forum.kirupa.com/u/demonqueller)
#### Post date: [August 22, 2004, 3:01pm UTC](https://forum.kirupa.com/t/problem-with-transitions-between-external-swfs/120233/3 "2004-08-22T15:01:02Z")

</div>

> [@Voetsjoeba](#):
>
> Are you sure you gave the container movieclip the instance name ‘container’ ? Also, are the buttons on the main timeline ? If not, then you’ll have to adjust the path to the container movieclip.

Yes to both questions.

On loading, Main\_EN.swf automatically calls Welcome\_EN.swf with this code:

\_root.currMovie = “Welcome\_EN”;  
container.loadMovie(\_root.currMovie+“.swf”);

And that works fine.

The buttons are in a movie clip symbol called “navigation” in Main\_EN.swf’s timeline. Does it matter if the symbol has an instance name on the timeline? Right now, it’s called, uh, navigation.

Thanks for your reply.

---

<div class="post-metadata">

### Author: ![Voetsjoeba](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@Voetsjoeba](https://forum.kirupa.com/u/Voetsjoeba)
#### Post date: [August 22, 2004, 3:09pm UTC](https://forum.kirupa.com/t/problem-with-transitions-between-external-swfs/120233/4 "2004-08-22T15:09:25Z")

</div>

The instance name of the button movieclip isn’t of great importance here, but it’s a good thing to give movieclips instance names. Since the buttons are in a seperate movieclip, you’ll have to adjust the path to the container movieclip (make sure it’s instance name is ‘container’, without the quotes). Like this:

```auto

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

```

By adding ‘\_parent’, we tell it to look up another level. Just container would look in the button movieclip ‘navigation’, and we need the parent movieclip of navigation which is \_root, so we add \_parent to the path.

---

<div class="post-metadata">

### Author: ![demonqueller](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@demonqueller](https://forum.kirupa.com/u/demonqueller)
#### Post date: [August 22, 2004, 4:10pm UTC](https://forum.kirupa.com/t/problem-with-transitions-between-external-swfs/120233/5 "2004-08-22T16:10:32Z")

</div>

Thanks a bunch! That did it. Now I can stop banging my head against the wall and return to some semblance of a life. If you’re curious about what you were helping me achieve, you might follow this link: [http://www.mangamerica.com/test.htm](http://www.mangamerica.com/test.htm)

It’s still a work in progress. I’m not done designing/coding all the swfs (only the e-mail and links buttons are active). And for some reason, the preloaders don’t always show up, and when they do, the loading is almost done, which defeats the purpose. … Weird. … But your input definitely helped me clear a big hurdle, so thanks again!

Take care.

> [@Voetsjoeba](#):
>
> The instance name of the button movieclip isn’t of great importance here, but it’s a good thing to give movieclips instance names. Since the buttons are in a seperate movieclip, you’ll have to adjust the path to the container movieclip (make sure it’s instance name is ‘container’, without the quotes). Like this:
> 
> ```auto
> 
> on (release) {
> if (_root.currMovie == undefined) {
> _root.currMovie = "Links_EN";
> _parent.container.loadMovie("Links_EN.swf");
> } else if (_root.currMovie != "Links_EN") {
> if (_parent.container._currentframe >= _parent.container.midframe) {
> _root.currMovie = "Links_EN";
> _parent.container.play();
> }
> }
> }
> 
> ```
> 
> By adding ‘\_parent’, we tell it to look up another level. Just container would look in the button movieclip ‘navigation’, and we need the parent movieclip of navigation which is \_root, so we add \_parent to the path.

---

<div class="post-metadata">

### Author: ![Voetsjoeba](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@Voetsjoeba](https://forum.kirupa.com/u/Voetsjoeba)
#### Post date: [August 22, 2004, 4:13pm UTC](https://forum.kirupa.com/t/problem-with-transitions-between-external-swfs/120233/6 "2004-08-22T16:13:06Z")

</div>

No problem … Didier is it ? 🙂 The preloader thingy is most likely because the content is already cached on your computer. Clear your cache, refresh and you should see the preloader again.

---

<div class="post-metadata">

### Author: ![demonqueller](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@demonqueller](https://forum.kirupa.com/u/demonqueller)
#### Post date: [August 22, 2004, 5:59pm UTC](https://forum.kirupa.com/t/problem-with-transitions-between-external-swfs/120233/7 "2004-08-22T17:59:57Z")

</div>

Hello, again,

A cached movie was my first thought, too, until I read elsewhere in these forums that certain components mess up preloaders because they export in the first frame, or something along those lines. I don’t know Action Script well enough to fix this.

Turns out, when I got rid of the scroll bars in the “Welcome” movie, the preloader worked OK. … My workaround is to use a button to click through the “What’s new” message. Not as practical, but it works.

Working with Flash is a neverending learning process for me. For every problem I fix, seems like two or three new ones pop up. Good thing there are people like you who know what they’re doing and don’t mind giving a hand to newbies like me. Thanks again.

> [@Voetsjoeba](#):
>
> No problem … Didier is it ? 🙂 The preloader thingy is most likely because the content is already cached on your computer. Clear your cache, refresh and you should see the preloader again.

---

<div class="post-metadata">

### Author: ![Voetsjoeba](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@Voetsjoeba](https://forum.kirupa.com/u/Voetsjoeba)
#### Post date: [August 22, 2004, 6:28pm UTC](https://forum.kirupa.com/t/problem-with-transitions-between-external-swfs/120233/8 "2004-08-22T18:28:09Z")

</div>

Ah yes, components are exported in the library and that exporting happens before anything else - also before your preloader is loaded. That’s why the preloader isn’t there for a second.
