# Go to a certain frame in a movie i'm loading

**URL:** https://forum.kirupa.com/t/go-to-a-certain-frame-in-a-movie-im-loading/22836
**Category:** flash
**Created:** [June 9, 2003, 1:41pm UTC](https://forum.kirupa.com/t/go-to-a-certain-frame-in-a-movie-im-loading/22836 "2003-06-09T13:41:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![easytiger](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/easytiger/32/232_2.png) [@easytiger](https://forum.kirupa.com/u/easytiger)
#### Post date: [June 9, 2003, 1:41pm UTC](https://forum.kirupa.com/t/go-to-a-certain-frame-in-a-movie-im-loading/22836/1 "2003-06-09T13:41:35Z")

</div>

I’m loading firstFloor.swf into an empty movieclip (photoMovies) in my main movie, but how do i tell it to go to a certain frame within firstFloor.swf. Here’s the code:

\_root.photoMovies.loadMovie(“firstFloor1.swf”,1);

Can any one help?

---

<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: [June 9, 2003, 2:00pm UTC](https://forum.kirupa.com/t/go-to-a-certain-frame-in-a-movie-im-loading/22836/2 "2003-06-09T14:00:42Z")

</div>

```auto

_root.photoMovies.loadMovie("firstFloor1.swf", "myMovie", 1);
_root.photoMovies.myMovie.gotoAndPlay("myFrame");

```

…I believe.

-M

---

<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: [June 10, 2003, 2:26pm UTC](https://forum.kirupa.com/t/go-to-a-certain-frame-in-a-movie-im-loading/22836/3 "2003-06-10T14:26:10Z")

</div>

if that doesnt work it could be  
\_root.loadMovie(“photoMovies”,“firstFloor1.swf”);

\_root.photoMovies.gotoAndPlay(“myFrame”);

one thing that might happen is that the gotoAndPlay will have no effect because the movie isnt fully loaded when it executes

i use this to delay things one frame  
onEnterFrame = function () {  
\_root.photoMovies.gotoAndPlay(“myFrame”);  
delete onEnterFrame;  
}

depending on the computer and the file size one frame might not be enough

so it would be better to put in a preloader-like thing

onEnterFrame=function(){  
if(photoMovies.getBytesLoaded()==photoMovies.getBytesTotal()){  
photoMovies.gotoAndPlay(“myFrame”);  
delete onEnterFrame;}  
}

of course, the problem with that is that if it executes right away, it might think the file has loaded when actually it hasnt started loading yet… so you better delay the whole thing one frame, then start checking the bytesLoaded, and when its loaded, send it to frame whatever.

Of Course, the first frame of the movie will flash on the screen for one frame before it jumps to the frame you want.

to avoid that I put a big movie clip in front of it to hide it, and then take it away when it is loaded

all this is avoiding using the onLoad method, which I have never been able to get to work. Anyone have better success with it?

---

<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: [June 10, 2003, 2:30pm UTC](https://forum.kirupa.com/t/go-to-a-certain-frame-in-a-movie-im-loading/22836/4 "2003-06-10T14:30:17Z")

</div>

This code makes sense but i can’t seem to get it to work and i’ve tried loads of variations.

Anyone got any ideas?

---

<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: [June 10, 2003, 3:56pm UTC](https://forum.kirupa.com/t/go-to-a-certain-frame-in-a-movie-im-loading/22836/5 "2003-06-10T15:56:08Z")

</div>

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=24589&postid=206066#post206066](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=24589&postid=206066#post206066)
