# loadMovie won't work with a variable

**URL:** https://forum.kirupa.com/t/loadmovie-wont-work-with-a-variable/178960
**Category:** flash
**Created:** [February 15, 2006, 6:48pm UTC](https://forum.kirupa.com/t/loadmovie-wont-work-with-a-variable/178960 "2006-02-15T18:48:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![necrotic](https://avatars.discourse-cdn.com/v4/letter/n/c89c15/32.png) [@necrotic](https://forum.kirupa.com/u/necrotic)
#### Post date: [February 15, 2006, 6:48pm UTC](https://forum.kirupa.com/t/loadmovie-wont-work-with-a-variable/178960/1 "2006-02-15T18:48:36Z")

</div>

Hello,

I’m fairly new to flash, so there is probably a simple answer to this. What I have right now is three functions defined in the first frame of my root movie. The three functions work togethor to allow each section of the site to show an intro, then the content, then an outro when the section is changed.

It works without using variables in load movie, like so:

```auto
switch (_global.page) {
    case "main":
        loadMovie("sections/main.swf", 1);
        break;
}

```

However, if I try to just do this:

```auto
loadMovie("sections/"+_global.page+".swf", 1);

```

or any variation (without the \_global. for example), then it doesn’t work. Does loadMovie have problems with variables? And I know the variable is set, I have a trace to show the variable at the start of the function, and the switch works perfectly.

Thanks for any help.
