# Passing Variables To A Loadmovie SWF

**URL:** <https://forum.kirupa.com/t/passing-variables-to-a-loadmovie-swf/102193>\
**Category:** Uncategorized\
**Created:** [February 20, 2004, 7:05pm UTC](https://forum.kirupa.com/t/passing-variables-to-a-loadmovie-swf/102193 "2004-02-20T19:05:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LFoz](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@LFoz](https://forum.kirupa.com/u/LFoz)\
**Post date:** [February 20, 2004, 7:05pm UTC](https://forum.kirupa.com/t/passing-variables-to-a-loadmovie-swf/102193/1 "2004-02-20T19:05:58Z")

</div>

I am having difficulties passing variables between SWF files that I am loading with LoadMovie(). I have searched around the forums here but haven’t found anything that seems to work. Here is what I am doing…

MovieA has a menu system for the user to interact with. I am using loadMovie() to load a SWF file that relates to the choice the user has made (ie. MovieB, MovieC or MovieD).

```auto

on(release) {
  loadMovie("MovieC.swf",_root);
}

```

The movie loads fine, but I cannot use

```auto
unloadmovie("_root.MovieC")

```

to remove MovieC and return to MovieA (which was originally loaded). Should I be using another loadmovie call instead (the flash documentation seems to indication that I should use unloadMovie, but I have a feeling that they are wrong in this instance).

Now the second problem I am running into is getting the variables that are held in MovieA to pass the data to the loaded movie.

I have seen suggestions that people have made to use : myNewArray=\_root.myOldArray.slice() but I have not been able to get this to work when I use it in MovieB thru D. It is almost like Flash removes the first movie from memory and then displays the new one that I have loaded before the variables can be passed.

I thought of perhaps sending this data to a location somewhere (such as a txt file for the time being), but Flash’s documentation on using ‘send’ is piss poor (much like the rest of their documentation).

Are there any thoughts or suggestions on how I can get the SWF files to play nicely with one another so that they pass the variables in/out correctly.

---

<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:** [February 24, 2004, 4:18am UTC](https://forum.kirupa.com/t/passing-variables-to-a-loadmovie-swf/102193/2 "2004-02-24T04:18:02Z")

</div>

Use loadMovieNum(movie, level) to load the movie and then unloadMovienum(level) to unload.
