# Loader waiting for variable to load...(help)

**URL:** <https://forum.kirupa.com/t/loader-waiting-for-variable-to-load-help/283080>\
**Category:** Uncategorized\
**Created:** [March 2, 2009, 2:17pm UTC](https://forum.kirupa.com/t/loader-waiting-for-variable-to-load-help/283080 "2009-03-02T14:17:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drawsoup](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/drawsoup/32/80_2.png) [@Drawsoup](https://forum.kirupa.com/u/Drawsoup)\
**Post date:** [March 2, 2009, 2:17pm UTC](https://forum.kirupa.com/t/loader-waiting-for-variable-to-load-help/283080/1 "2009-03-02T14:17:01Z")

</div>

Hey there!  
I think i might need some help here.  
I have this setup, where i want an MC to load an external movie. But the external .swf is to be determined in the onRelease-function in the main timeline.  
something like this…

main timeline-button:

```auto

loader_btn.onRelease = function (){
     _global.some_variable = "some_swf";
          tellTarget("some_MC"){
          gotoAndStop("load");
     }
}

```

and then in the ‘some\_MC’ on the frame called ‘load’:

```auto

stop();
this.onEnterFrame = function(){
     if (some_variable == undefined){
          null;
     }else{
          myContainer.loadMovie(some_variable+".swf");
     }
}

```

This cycle only has one problem…IT’S A CYCLE. 25 times a second, i’m told that ‘undefined.swf’ could not be loaded.  
Is there some clever way of solving this? Some kind of a loader just quitely waiting for a function, without having to spit something out 25 times a second?  
Is it a MovieClipLoader? Is it a bird? Is it a plane?

cheers!

mikz
