# Defining variables/actions in external movies

**URL:** <https://forum.kirupa.com/t/defining-variables-actions-in-external-movies/258056>\
**Category:** flash\
**Created:** [April 20, 2008, 12:29pm UTC](https://forum.kirupa.com/t/defining-variables-actions-in-external-movies/258056 "2008-04-20T12:29:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![setzer9999](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@setzer9999](https://forum.kirupa.com/u/setzer9999)\
**Post date:** [April 20, 2008, 12:29pm UTC](https://forum.kirupa.com/t/defining-variables-actions-in-external-movies/258056/1 "2008-04-20T12:29:30Z")

</div>

Hey everybody,

I have a question about movies loaded to the main movie via loadMovieNum.

1. I have a movie, called “index.swf”, another movie called “main.swf”, and another movie called “about.swf”

2. On the only frame in “index.swf” I have the code

> 

loadMovieNum(“main.swf”,1)

1. On a specified frame in “main.swf” I have the code

> 

loadMovieNum(“about.swf”,2)

1. In the movie “main.swf” I have a button with this code

[quote]  
on(press){  
//to unload movie “about.swf”  
unloadMovieNum(2);  
//to continue to the next frame of “main.swf”  
gotoAndPlay(19);  
//code related to “main.swf”  
var skip2:Boolean = new Boolean();  
skip2=true;  
}

1. I do not want “about.swf” to simply unload and disappear though. I would like for the button in “main.swf” to be able to create a Boolean value within “about.swf” and tell it to play the next frame and finish playing the movie to the end before unloading the movie. With the parts I don’t know actionscript syntax for, the English translation of the code might look like what is between the _english_ tags:

> 

on(press){  
_english_ Create Boolean variable in current frame of “about.swf”;  
play next frame of “about.swf”;  
only when “about.swf” is complete (has reached its final frame) then do next  
line of code on this button;_english_  
unloadMovieNum(2);

```
gotoAndPlay(19);
  
var skip2:Boolean = new Boolean();
skip2=true;

```

}

I hope the idea of the _english_ tags help and don’t confuse. Thanks for reading! I’m a complete amateur at this, but I’m not just copying code to do something. I’m learning how to apply this code in multiple ways, so I hope no one finds me annoying. This forum is great.
