# Navigation for external movie

**URL:** <https://forum.kirupa.com/t/navigation-for-external-movie/57928>\
**Category:** Uncategorized\
**Created:** [July 17, 2004, 10:24pm UTC](https://forum.kirupa.com/t/navigation-for-external-movie/57928 "2004-07-17T22:24:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyze](https://avatars.discourse-cdn.com/v4/letter/c/a4c791/32.png) [@cyze](https://forum.kirupa.com/u/cyze)\
**Post date:** [July 17, 2004, 10:24pm UTC](https://forum.kirupa.com/t/navigation-for-external-movie/57928/1 "2004-07-17T22:24:39Z")

</div>

okay, i browsed thru alot of posts here, but i dont seem to figure it out myself, so please help me. i unfortunatly can’t post the fla’s here, cause my client would kill me ☹

so, basically i got a few swfs. the first one is “main.swf” and the second one is “external\_01.swf” and so on.  
i dynamically create a blank movieClip in “main.swf” in which i can load all the “external\_xx.swf” files, based on what buttons i click, which all works out perfectly fine. my problem is the following: i got one external file that has quite alot data, all divided by labels on the main timeline of that “external\_01.swf”.  
but somehow i can’t seem to navigate to these labels from the “main.swf”.

here is the code so far for one button in “main.swf”:

**on (release) {  
\_root.loadercontainer.loadMovie(“preloader.swf”);  
\_root.mccontainer5.loadMovie(“clips/external\_01.swf”);  
\_root.mccontainer5.gotoAndPlay(“hans”);  
}**

so, nevermind the preloader just tell me, how i can get the “external\_01.swf” to play the label “hans”?

thx alot for the help - cheers, cyze.

---

<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, 10:33pm UTC](https://forum.kirupa.com/t/navigation-for-external-movie/57928/2 "2004-07-17T22:33:26Z")

</div>

> [@cyze](#):
>
> okay, i browsed thru alot of posts here, but i dont seem to figure it out myself, so please help me. i unfortunatly can’t post the fla’s here, cause my client would kill me ☹
> 
> so, basically i got a few swfs. the first one is “main.swf” and the second one is “external\_01.swf” and so on.  
> i dynamically create a blank movieClip in “main.swf” in which i can load all the “external\_xx.swf” files, based on what buttons i click, which all works out perfectly fine. my problem is the following: i got one external file that has quite alot data, all divided by labels on the main timeline of that “external\_01.swf”.  
> but somehow i can’t seem to navigate to these labels from the “main.swf”.
> 
> here is the code so far for one button in “main.swf”:
> 
> **on (release) {  
> \_root.loadercontainer.loadMovie(“preloader.swf”);  
> \_root.mccontainer5.loadMovie(“clips/external\_01.swf”);  
> \_root.mccontainer5.gotoAndPlay(“hans”);  
> }**
> 
> so, nevermind the preloader just tell me, how i can get the “external\_01.swf” to play the label “hans”?
> 
> thx alot for the help - cheers, cyze.

You need to check if it has loaded before you can tell it to do anything. Set up a loop to check getBytesLoaded()/getBytestotal() of your container.

---

<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, 10:43pm UTC](https://forum.kirupa.com/t/navigation-for-external-movie/57928/3 "2004-07-17T22:43:52Z")

</div>

erm, and how can i do this? i am not too good at action script yet… would be really appreciated if you cold help me a bit more.

thx - cyze

---

<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, 11:05pm UTC](https://forum.kirupa.com/t/navigation-for-external-movie/57928/4 "2004-07-17T23:05:16Z")

</div>

> [@cyze](#):
>
> erm, and how can i do this? i am not too good at action script yet… would be really appreciated if you cold help me a bit more.
> 
> thx - cyze

Just make a simple preloading function, something like this

function loader() {  
var loading = Math.floor(mccontainer5.getBytesLoaded()/1024);  
var total = Math.floor(mccontainer5.getBytesTotal()/1024);  
if (loading\>=total && loading\>1) {  
mccontainer5.gotoAndPlay(“hans”);  
}  
}

call the function after loadmovie.(oops nearly forgot:- you need to call with either enterFrame or setInterval. I have some examples if you get stuck

---

<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, 11:17pm UTC](https://forum.kirupa.com/t/navigation-for-external-movie/57928/5 "2004-07-17T23:17:11Z")

</div>

actually, i think i might have found another good solution to my problem:

for main.swf:

**on (release) {**  
**\_root.loadercontainer.loadMovie(“preloader.swf”);**  
**\_root.mccontainer5.loadMovie(“clips/external\_01.swf”);**  
**\_root.framepos = “hans”;**  
**}**

i can replace “hans” with any other label in the “external\_01.swf”, depending on wich label has to be displayed.

and for a frame in external\_01.swf:

**stop();**  
**if (\_root.framepos == “hans”) {**  
**gotoAndPlay(“hans”);**  
**}**  
**if (\_root.framepos == “otherlabelname”) {**  
**gotoAndPlay(“otherlabelname”);**  
**}**  
**…**

it seems to work for me… what do you think, stringy?

---

<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, 11:30pm UTC](https://forum.kirupa.com/t/navigation-for-external-movie/57928/6 "2004-07-17T23:30:57Z")

</div>

> [@cyze](#):
>
> actually, i think i might have found another good solution to my problem:
> 
> for main.swf:
> 
> **on (release) {**  
> **\_root.loadercontainer.loadMovie(“preloader.swf”);**  
> **\_root.mccontainer5.loadMovie(“clips/external\_01.swf”);**  
> **\_root.framepos = “hans”;**  
> **}**
> 
> i can replace “hans” with any other label in the “external\_01.swf”, depending on wich label has to be displayed.
> 
> and for a frame in external\_01.swf:
> 
> **stop();**  
> **if (\_root.framepos == “hans”) {**  
> **gotoAndPlay(“hans”);**  
> **}**  
> **if (\_root.framepos == “otherlabelname”) {**  
> **gotoAndPlay(“otherlabelname”);**  
> **}**  
> **…**
> 
> it seems to work for me… what do you think, stringy?

well if you are comfortable with that, thats all that matters. I like to to keep all code together(if i can)

if you put something like this on your main timeline  
createEmptyMovieClip(“mccontainer5”, 5);  
function loader(clip) {  
var loading = Math.floor(clip.getBytesLoaded()/1024);  
var total = Math.floor(clip.getBytesTotal()/1024);  
percent = loading/total;  
//textfield variable name loading\_txt  
loading\_txt = Math.floor(percent\*100)+" % loaded "+clip.\_name;  
if (loading == total && loading\>1) {  
clearinterval(myInterval);  
//all control is yours from here  
clip.gotoAndPlay(“whatever”);  
clip.\_x = 200;  
clip.\_yscale = 50;  
clip.\_xscale = 50;  
}  
}

//and on your button

on (release) {  
\_root.mccontainer5.loadMovie(“movie1.swf”);  
myinterval = setInterval(loader, 20, mccontainer5);  
}

this would also serve as a preloader and the function can be reused by your other buttons.

---

<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, 11:39pm UTC](https://forum.kirupa.com/t/navigation-for-external-movie/57928/7 "2004-07-17T23:39:26Z")

</div>

okay, nice. i have copied the text so i can try this one out aswell.  
but as i allready have got a preloader for the external swfs (a neat little on with textfields for the bytes and a bar and stuff) and the way i posted before works for me at the moment - i will stick with that for now… as i am really short on time for this project… but thx alot for your time and help.

regards from berlin, cyze.
