# Passing Variables to Flash

**URL:** <https://forum.kirupa.com/t/passing-variables-to-flash/123170>\
**Category:** Uncategorized\
**Created:** [September 21, 2004, 4:55am UTC](https://forum.kirupa.com/t/passing-variables-to-flash/123170 "2004-09-21T04:55:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreeft](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@dreeft](https://forum.kirupa.com/u/dreeft)\
**Post date:** [September 21, 2004, 4:55am UTC](https://forum.kirupa.com/t/passing-variables-to-flash/123170/1 "2004-09-21T04:55:17Z")

</div>

Hey Everybody,

I’m new here, but I’ve used the site many times for flash research, so I thought I’d do the right thing and join up.

I’ve been having an issue using the [Passing Variables to Flash tutorial inside a single frame flash document. The document itself contains a MC that works using the [url=“http://www.kirupa.com/developer/mx/preloader\_transition.htm”]Preloader & Transition of Dynamic Files](http://www.kirupa.com/developer/actionscript/tricks/passingvariables.htm) tutorial. I have used the \_x and \_y properties to movie an image Inside each of the preloaded movies.

The code for the first frame of the document I am trying to pass the variable to, is as follows:

if (movie=="" or movie==1) {  
\_root.section = “image1.swf”;  
}  
if (movie==2) {  
\_root.section = “image2.swf”;  
}  
if (movie==3) {  
\_root.section = “image3.swf”;  
}  
else {  
\_root.section = “image3.swf”;  
}

However, when the movie is run, the code will always go to the else, no matter what the parameter specified in the URL is. I can only assume this has something to do with the fact that it is looping on the first frame.

Thanks in advance,

dreeft.
