# Passing variables to a loaded movie

**URL:** https://forum.kirupa.com/t/passing-variables-to-a-loaded-movie/120583
**Category:** Uncategorized
**Created:** [August 25, 2004, 3:57pm UTC](https://forum.kirupa.com/t/passing-variables-to-a-loaded-movie/120583 "2004-08-25T15:57:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bscene](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@bscene](https://forum.kirupa.com/u/bscene)
#### Post date: [August 25, 2004, 3:57pm UTC](https://forum.kirupa.com/t/passing-variables-to-a-loaded-movie/120583/1 "2004-08-25T15:57:26Z")

</div>

[font=verdana, arial, helvetica][size=2]I have a navigation bar that I have loaded into level3 of my main movie. When the user clicks one of the navigation buttons they should be taken to a specific point on the timeline of a movie that I have loaded into level2 of my main movie. Currently it will only go to the specified frame if the button is pressed a second time.

Here is the action I have for the buttons…

on (release) {  
frame = “af”; // this value is different for each button  
unloadMovieNum (2);  
loadMovieNum (“globes.swf”, 2, “GET”);  
}

On the first frame of my level2 movie (globes.swf), I have the following action to check for the value of “frame” and then take the appropriate action

if (frame != “”) {  
gotoAndPlay(frame);  
} else {  
gotoAndPlay(“rotate”);  
}

I am really puzzled on how to accomplish this.  
Any help is greatly appreciated. [/size][/font]

---

<div class="post-metadata">

### Author: ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)
#### Post date: [August 25, 2004, 4:27pm UTC](https://forum.kirupa.com/t/passing-variables-to-a-loaded-movie/120583/2 "2004-08-25T16:27:59Z")

</div>

> [@bscene](#):
>
> [font=verdana, arial, helvetica][size=2]I have a navigation bar that I have loaded into level3 of my main movie. When the user clicks one of the navigation buttons they should be taken to a specific point on the timeline of a movie that I have loaded into level2 of my main movie. Currently it will only go to the specified frame if the button is pressed a second time.
> 
> Here is the action I have for the buttons…
> 
> on (release) {  
> frame = “af”; // this value is different for each button  
> unloadMovieNum (2);  
> loadMovieNum (“globes.swf”, 2, “GET”);  
> }
> 
> On the first frame of my level2 movie (globes.swf), I have the following action to check for the value of “frame” and then take the appropriate action
> 
> if (frame != “”) {  
> gotoAndPlay(frame);  
> } else {  
> gotoAndPlay(“rotate”);  
> }
> 
> I am really puzzled on how to accomplish this.  
> Any help is greatly appreciated. [/size][/font]

i don` think you need this line  
unloadMovieNum (2);

when you are loading in movies, you have to make sure that it is fully loaded before you can tell it to do anything.so basically you need a simple preloader type script.
