# Targeting a framelabel in a .swf

**URL:** <https://forum.kirupa.com/t/targeting-a-framelabel-in-a-swf/3789>\
**Category:** Uncategorized\
**Created:** [September 16, 2001, 1:23pm UTC](https://forum.kirupa.com/t/targeting-a-framelabel-in-a-swf/3789 "2001-09-16T13:23:28Z")\
**Posts on this page:** 12\
**Page:** 1

<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:** [September 16, 2001, 1:23pm UTC](https://forum.kirupa.com/t/targeting-a-framelabel-in-a-swf/3789/1 "2001-09-16T13:23:28Z")

</div>

im wondering if any of u guys know how u target a certain framelabel on “loadmovie”. i got these buttons that loads an .swf, and i want to go to different frames on the different buttons…

ex: button 1 loads the .swf and goes to frame1,  
button 2 loads the same .swf and goes to frame20  
button 3 loads the same .swf and goes to frame30  
etc etc

---

<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:** [September 16, 2001, 3:48pm UTC](https://forum.kirupa.com/t/targeting-a-framelabel-in-a-swf/3789/2 "2001-09-16T15:48:54Z")

</div>

\_root.loadmovie.gotoAndStop(“framelabel”);

the quotes are important. is this what you meant?

---

<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:** [September 16, 2001, 4:33pm UTC](https://forum.kirupa.com/t/targeting-a-framelabel-in-a-swf/3789/3 "2001-09-16T16:33:21Z")

</div>

## hmm i think so… but i couldnt get it to work…this is what i got now on the button:

## on (release) { &nbsp &nbsp &nbsp &nbsp loadMovieNum (“preloader.swf”, 3); }

so were do i put in the:

\_root.loadmovie.gotoAndStop(“framelabel”);

---

<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:** [September 16, 2001, 8:20pm UTC](https://forum.kirupa.com/t/targeting-a-framelabel-in-a-swf/3789/4 "2001-09-16T20:20:49Z")

</div>

oh, and you want the loaded movie to go to particular frames under particular cirumstances. ok, here’s a method:

set a variable in the main timeline (probably with the same button action):

frametarg = 20;

and then in the first frame of the movie you’re loading:

gotoAndStop(\_level0.frametarg);

in this case it’s important _not_ to put quotes, since your referencing a variable rather than a string.

---

<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:** [September 16, 2001, 9:06pm UTC](https://forum.kirupa.com/t/targeting-a-framelabel-in-a-swf/3789/5 "2001-09-16T21:06:59Z")

</div>

## well i put this on the button:

## on (release) { \_ \_ \_ \_ loadMovieNum (“preloader.swf”, 3); \_ \_ \_ \_ frametarg = 30; }

## and this on the MC´s 1st frame i had:

## gotoAndStop(\_level0.frametarg);

## i couldnt get it to work… i even tried with:

## setframetarg = 30;

u think u could explain why i put in:

gotoAndStop(\_level0.frametarg);

on the first frame in the loaded MC ? is it becouse it should act like a reference spot of were the: \_level0 is ?

it would be really helpful if u or anybody else could type in the exact code of what i should put on the buttons and other places…

i really need to solve this asap and i am grateful for your help!

also if u or someboby else know another way pls post 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:** [September 16, 2001, 9:37pm UTC](https://forum.kirupa.com/t/targeting-a-framelabel-in-a-swf/3789/6 "2001-09-16T21:37:26Z")

</div>

## YES!!! i solved it by preloading the MC with the main movie… i have a stop action on its first frame so u cant see it… the i just put in:

## on (release) { &nbsp &nbsp &nbsp &nbsp tellTarget ("\_level3") { &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp gotoAndPlay (“news”); &nbsp &nbsp &nbsp &nbsp } }

etc etc on each button… 🙂 tnx anyway man !

---

<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:** [September 16, 2001, 9:38pm UTC](https://forum.kirupa.com/t/targeting-a-framelabel-in-a-swf/3789/7 "2001-09-16T21:38:11Z")

</div>

\_level0 refers to the movie in level 0. it’s important to use the compete path to variables or flash can’t find them.

“frametarg” was arbitrarily chosen, you could have called it “howard” and it work just as well.

perhaps in the button put the variable in to \_level0 explicitly:

\_level0.howard = 20;

if you button was in a movie, that would explain why it’s not working. if you added the path to the movie when you reference it from the loaded clip, it would also solve this problem ie:

gotoAndStop(\_level0.moviewithbutton.howard);

don’t do both though! ; )

i think perhaps i don’t quite understand what you’re trying to do. which movie do you want to go to frame “howard”?

---

<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:** [September 16, 2001, 9:40pm UTC](https://forum.kirupa.com/t/targeting-a-framelabel-in-a-swf/3789/8 "2001-09-16T21:40:34Z")

</div>

we cross posted, congrats!!

you could also write:

on(release){  
\_level3.gotoAndStop(“news”);  
}

hey, how did you get your code to format like you did?

---

<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:** [September 17, 2001, 6:51am UTC](https://forum.kirupa.com/t/targeting-a-framelabel-in-a-swf/3789/9 "2001-09-17T06:51:15Z")

</div>

hehe 🙂

waddaya mean with “code to format” ?

---

<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:** [September 18, 2001, 4:42am UTC](https://forum.kirupa.com/t/targeting-a-framelabel-in-a-swf/3789/10 "2001-09-18T04:42:36Z")

</div>

every time i indent code, this message board removes all the whitespace and it’s all up against the left margin.

how did you make your indents stick?

thanks in advance!

---

<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:** [September 18, 2001, 9:35am UTC](https://forum.kirupa.com/t/targeting-a-framelabel-in-a-swf/3789/11 "2001-09-18T09:35:43Z")

</div>

hey suprabeener,  
I too have found that problem, and it is quite annoying. I type the code in NotePad, and then I paste the code into ezboard. Notepad does a great job of adding spaces instead of indent marks so the code is indented properly. Luckily for us, Flash doesn’t really care about the spaces and indents the code accordingly in the Actions window!

---

<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:** [September 18, 2001, 1:20pm UTC](https://forum.kirupa.com/t/targeting-a-framelabel-in-a-swf/3789/12 "2001-09-18T13:20:56Z")

</div>

i just pasted it in here directly after copying it in flash…  
ctrl+c and then i pasted it with ctrl+v
