# loadMovie and go to specific frame - need help desperately!

**URL:** <https://forum.kirupa.com/t/loadmovie-and-go-to-specific-frame-need-help-desperately/221394>\
**Category:** Uncategorized\
**Created:** [April 3, 2007, 10:50pm UTC](https://forum.kirupa.com/t/loadmovie-and-go-to-specific-frame-need-help-desperately/221394 "2007-04-03T22:50:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdowling](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@kdowling](https://forum.kirupa.com/u/kdowling)\
**Post date:** [April 3, 2007, 10:50pm UTC](https://forum.kirupa.com/t/loadmovie-and-go-to-specific-frame-need-help-desperately/221394/1 "2007-04-03T22:50:17Z")

</div>

Hi All,

I have a main.fla and in I have a holder\_mc which holds thumbnails. Each thumbnail is a button and when clicked loads in wedding\_large.swf. the problem is I need to go to frame 2 when wedding\_large.swf is loaded. I have done alot of searching on vaious forums and found that easiest way seems to be to declare a global variable, trace it, call it in the newly loaded swf and if its the same gotoAndPlay(2);. I have it working one way…

wedding\_large.swf:

```auto
back_btn.onRelease = function() {
 _global.xx = 1;
 trace(xx);
 loadMovieNum("main.swf",0); 
}

```

main.swf:

```auto
stop();
trace(xx);
if(xx == 1)
{
 gotoAndStop(2);
}

```

this code works perfectly for me but when I try it from the thumbnail in main.swf to the larger image preview in wedding\_large.swf it just goes to the first frame…

mainf.swf (code on thumbnail button):

```auto
on (release) {
 _global.xx = 2;
 trace(xx);
 loadMovieNum("wedding_large.swf",0);
}

```

wedding\_larger.swf:

```auto
stop();
trace(xx);
if(xx == 2)
{
 gotoAndStop(2);
}

```

the above code does not work. Is it because im declaring the global variable from a movie clip within a movie and not calling it from the main timeline? surely not if it is a global variable! I have tried to run from the main timeline in main.swf like this:

thumb1L.holder.onRelease = function(){ //where holder is the mc that holds the thumbnails  
\_global.xx = 2;  
trace(xx);  
loadMovieNum(“wedding\_large.swf”,0);  
}  
but it still doesnt work. I cant understand it as works one way and not the other

Any help would be welcomed as the pressure is really on the get this finished.

thanks 🙂
