# How to specific the target frame of loadMovie

**URL:** <https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616>\
**Category:** flash\
**Created:** [July 15, 2003, 1:55am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616 "2003-07-15T01:55:17Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![hysterickin](https://avatars.discourse-cdn.com/v4/letter/h/ccd318/32.png) [@hysterickin](https://forum.kirupa.com/u/hysterickin)\
**Post date:** [July 15, 2003, 1:55am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/1 "2003-07-15T01:55:17Z")

</div>

To all flasher~

On regarding to this tutorial from this website:

[COLOR=orangered]Preloader and Transition for Dynamic Files[/COLOR]  
[http://www.kirupa.com/developer/mx/preloader\_transition.htm](http://www.kirupa.com/developer/mx/preloader_transition.htm)

How do I target the frame of the loadMovie swf???

Please help!! THANKS

Hysterickin

---

<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:** [July 15, 2003, 2:47am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/2 "2003-07-15T02:47:07Z")

</div>

I’m pretty sure its not possible…

---

<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:** [July 15, 2003, 3:00am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/3 "2003-07-15T03:00:32Z")

</div>

☹  
Really?  
I am making a flash that can have preloader for loading swfs.

I got some buttons, for e.g.

button1 to load news.swf  
button2 to load about.swf ( frame 1 )  
button3 to load about.swf ( frame2 )

Is it possible ???

---

<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:** [July 15, 2003, 3:41am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/4 "2003-07-15T03:41:21Z")

</div>

You can do it that way by putting the loadMovie AS in the frame that you are going to as long as the movieClip that you are loading to (section) exists in that frame.

In the tut that you mentioned, the movieClip name is ‘section’. Put the actions in the timeline like:  
[AS]  
\_root.section.loadMovie(“news.swf”);  
//or  
\_root.section.loadMovie(“about.swf”);  
[/AS]  
When flash get’s to it in the timeline, it will activate it. Is that what you were talking about?

---

<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:** [July 15, 2003, 3:56am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/5 "2003-07-15T03:56:35Z")

</div>

Here is the code for button to select movies

[COLOR=red]  
b1.onRelease = function() {  
if (\_root.section != “profile.swf”) {  
\_root.section = “profile.swf”;  
\_root.transition.gotoAndPlay(“closing”);  
}  
};  
b2.onRelease = function() {  
if (\_root.section != “gallery.swf”) {  
\_root.section = “gallery.swf”;  
\_root.transition.gotoAndPlay(“closing”);  
}  
};  
b3.onRelease = function() {  
if (\_root.section != “photos.swf”) {  
\_root.section = “photos.swf”;  
\_root.transition.gotoAndPlay(“closing”);  
}  
};

## [/COLOR]

Here is the code to load the movie

[COLOR=red]  
loadMovie(\_root.section, \_root.content);  
stop();  
[/COLOR]

My question is,  
how do I assign b3 to load “photos.swf” in a target frame 4 ?

---

<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:** [July 15, 2003, 4:01am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/6 "2003-07-15T04:01:43Z")

</div>

I should charify my question:

How do I assign b3 ( button3 ) to load “photos.swf” to its  
frame 4?

---

<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:** [July 15, 2003, 5:02am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/7 "2003-07-15T05:02:31Z")

</div>

That code looks right. I use a different method alltogether, but yours should work. I really need to see where all these actions reside in the movie.

Your q is how do you assign b3; if b1 and b2 are working, then it might be a linking problem with the file names and/or locations - the logic is the same in all three sections of the script.

Other than that, post your fla(s) and I will look at 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:** [July 15, 2003, 5:56am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/8 "2003-07-15T05:56:50Z")

</div>

nonononono…  
The above code is ok, but right now, I want to add a function which it can tell the loaded swf to start from different frame.

The default is set to start movie from frame 1,  
but I want it start from frame 4.

---

<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:** [July 15, 2003, 6:00am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/9 "2003-07-15T06:00:27Z")

</div>

Make frame number 4 the first frame of your movie.

---

<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:** [July 15, 2003, 6:06am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/10 "2003-07-15T06:06:50Z")

</div>

What if I have another button calling same movie but different frame.  
Because I have a button calling that swf frame 3~

---

<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:** [July 15, 2003, 6:11am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/11 "2003-07-15T06:11:51Z")

</div>

Use one movie for each button.

---

<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:** [July 15, 2003, 6:15am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/12 "2003-07-15T06:15:31Z")

</div>

Well, because I got about 20+ buttons.  
And some movie have similar things.  
THat’s why I want different button calling same movie but different frame.

I am just wondering why it is so difficult to solve.  
But if this problem couldn’t be solve…maybe I need to move ahead and make 20+ swf ;(

---

<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:** [July 15, 2003, 7:17am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/13 "2003-07-15T07:17:28Z")

</div>

Ok there is a way around this. On each button click we will assing a value to a variable, lets call it “counter” (no quotes).  
The code on button 1 will be this:

```auto
b1.onRelease = function() {
if (_root.section != "profile.swf") {
_root.section = "profile.swf";
_root.counter=1; 
_root.transition.gotoAndPlay("closing");
}
};[/AS]On b2, counter=2; on b3, counter =3; and so on....
Now on your external, make first frame empty and place the following actions:[AS]stop();
if(_root.counter==1){
	this.gotoAndStop(5)//b1 pressed leads to frame 5 of the external
}
if(_root.counter==2){
	this.gotoAndStop(10)//b2 leads to frame 10 and so on....
}[/AS]Make as many statements as the number of values of "counter". Now on the respective frame place whatever you want to appear.
```

---

<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:** [July 15, 2003, 7:43am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/14 "2003-07-15T07:43:20Z")

</div>

Woo~~~

Let me try it out~  
THX!!!

---

<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:** [July 15, 2003, 7:50am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/15 "2003-07-15T07:50:02Z")

</div>

You’re welcome. Let me know if you get this working.  
I havent tested that, but should work

---

<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:** [July 15, 2003, 9:49am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/16 "2003-07-15T09:49:43Z")

</div>

oh boy oh boy~~~  
it works !!!

Cool~  
simple and fast  
thx !!!

---

<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:** [July 15, 2003, 9:54am UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/17 "2003-07-15T09:54:09Z")

</div>

Anytime 🙂

---

<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:** [July 15, 2003, 3:50pm UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/18 "2003-07-15T15:50:33Z")

</div>

Why I can’t do this?

var j;  
for (j=10; j\<16; j++){  
course[j].onRelease = function() {  
if (\_root.section != “course.swf” or \_root.counter != j) {  
\_root.section = “course.swf”;  
\_root.counter = j;  
\_root.transition.gotoAndPlay(“closing”);  
}  
}

};

I want the result to be…

course[10].onRelease = function() {  
if (\_root.section != “course.swf” or \_root.counter !=10) {  
\_root.section = “course.swf”;  
\_root.counter = 10;  
\_root.transition.gotoAndPlay(“closing”);  
}  
}  
course11.onRelease = function() {  
if (\_root.section != “course.swf” or \_root.counter != 11) {  
\_root.section = “course.swf”;  
\_root.counter = 11; \_root.transition.gotoAndPlay(“closing”);  
}  
}  
course12.onRelease = function() {  
if (\_root.section != “course.swf” or \_root.counter != 12) {  
\_root.section = “course.swf”;  
\_root.counter = 12;  
\_root.transition.gotoAndPlay(“closing”);  
}  
}

and so on…

pls 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:** [July 15, 2003, 4:05pm UTC](https://forum.kirupa.com/t/how-to-specific-the-target-frame-of-loadmovie/25616/19 "2003-07-15T16:05:12Z")

</div>

Ok try this:[AS]var j;  
for (j=10; j\<16; j++) {  
this[“course”+j].Num = j;  
this[“course”+j].onPress = function() {  
if (\_root.section != “course.swf” && \_root.counter != j) {  
\_root.section = “course.swf”;  
\_root.counter = this.Num;  
\_root.transition.gotoAndPlay(“closing”);  
}  
};  
}[/AS]
