# loadMovie with variables

**URL:** <https://forum.kirupa.com/t/loadmovie-with-variables/13418>\
**Category:** flash\
**Created:** [February 13, 2003, 1:35am UTC](https://forum.kirupa.com/t/loadmovie-with-variables/13418 "2003-02-13T01:35:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdzines](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@kdzines](https://forum.kirupa.com/u/kdzines)\
**Post date:** [February 13, 2003, 1:35am UTC](https://forum.kirupa.com/t/loadmovie-with-variables/13418/1 "2003-02-13T01:35:24Z")

</div>

hi,

I’m working on a site where i want to pass around some variables to determine which external swf is loaded.

i’m having sooo many problems, hopefully someone can help.

on the most basic level, i did a test as follows:

i made a mc on the stage named holder

i also made a button and a controller mc (where the code is kept)

on the button i put:

on(release ){  
\_root.loaditup=1;  
}

then on the controller mc i put:

onClipEvent(enterFrame){  
if(\_root.loaditup==1){

\_root.holder.loadMovie(“movie6.swf” );  
}  
}

Why does this not work?!

I can’t believe i’m so stuck on this. What i’m actually trying to do is more complicated but at the most basic level i need to understand how to make this code load the external movie “movie6.swf” by referencing a variable.

The files are all in the same folder and i’ve done diriect testing and it works fine. i.e.

on (release ){  
\_root.holder.loadMovie(“movie6.swf” );  
}

so i know all the paths are fine.

Please can someone help me with this?

thanks so much

kd

---

<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 13, 2003, 1:48am UTC](https://forum.kirupa.com/t/loadmovie-with-variables/13418/2 "2003-02-13T01:48:46Z")

</div>

sorry pom,

this is a flash mx problem

---

<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 13, 2003, 9:10am UTC](https://forum.kirupa.com/t/loadmovie-with-variables/13418/3 "2003-02-13T09:10:24Z")

</div>

There’s a problem in your code. Because you load onEnterFrame, so you load over and over and over and over (and over). Just change the variable once the loading begins:

```auto
onClipEvent(enterFrame){
  if(_root.loaditup==1){
    _root.holder.loadMovie("movie6.swf" );
    _root.loaditup--;
  }
}

```

pom :trout:

---

<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 13, 2003, 1:06pm UTC](https://forum.kirupa.com/t/loadmovie-with-variables/13418/4 "2003-02-13T13:06:08Z")

</div>

cheers!

I figured it out at 3 in the morning last night!

You know when u have one of those days?!

Anyway thanks very much for your help, it is greatly appreciated.

laters,

kd
