# Framelabels

**URL:** <https://forum.kirupa.com/t/framelabels/27130>\
**Category:** flash\
**Created:** [July 30, 2003, 1:02pm UTC](https://forum.kirupa.com/t/framelabels/27130 "2003-07-30T13:02:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![thorseye](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thorseye/32/66_2.png) [@thorseye](https://forum.kirupa.com/u/thorseye)\
**Post date:** [July 30, 2003, 1:02pm UTC](https://forum.kirupa.com/t/framelabels/27130/1 "2003-07-30T13:02:04Z")

</div>

I’m doing a thing where I need to go to a certain framelabel. Which framelabel to go to is decided by the variable costumer, and it should end with a b. How would I write this?  
gotoAndPlay(\_root.costumer+“b”) doesn’t go to a label, right? So what’s the syntax for this? Guess this is an easy one, but I just can’t figure it out right now…  
Thanks!

---

<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 30, 2003, 1:10pm UTC](https://forum.kirupa.com/t/framelabels/27130/2 "2003-07-30T13:10:52Z")

</div>

I dont quite get your idea  
:-\

---

<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 30, 2003, 1:20pm UTC](https://forum.kirupa.com/t/framelabels/27130/3 "2003-07-30T13:20:34Z")

</div>

If i get you right, declare your variable like this:

```auto
customer = "fram";

```

Now if the frame you want to go is labeled _frame_, use the following code:

```auto
this.gotoAndPlay(customer+"e");

```

---

<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 30, 2003, 1:28pm UTC](https://forum.kirupa.com/t/framelabels/27130/4 "2003-07-30T13:28:14Z")

</div>

No, that doesn’t work. That code tells flash to do like this:  
[AS]gotoAndPlay(frame)[/AS] but if I want to go to a framelabel, I have to use “” around the frame-name, like this:  
[AS]gotoAndPlay(“frame”)[/AS] So my question again:  
How do I get the \_root.costumer inside the “”?  
Hope that explained what I need…

---

<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 30, 2003, 1:29pm UTC](https://forum.kirupa.com/t/framelabels/27130/5 "2003-07-30T13:29:33Z")

</div>

If you use the code i provided, it will gotoAndPlay the frame labeled “frame” (no quotes).

---

<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 30, 2003, 1:33pm UTC](https://forum.kirupa.com/t/framelabels/27130/6 "2003-07-30T13:33:26Z")

</div>

It is always best to first define the variable, then use it, instead of define-when-using. Your variable customer is stored in \_root, right ? Then I think the best thing to do is:

[AS]  
customer = \_root.customer+“a”;//store the \_root var in a local var and add a or b to it  
gotoAndPlay(customer);  
[/AS]

If you use an “on” event handler ( like on(release){… ), make sure that the customer = \_root.customer+“a” line is also located inside the handler.

---

<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 30, 2003, 1:40pm UTC](https://forum.kirupa.com/t/framelabels/27130/7 "2003-07-30T13:40:12Z")

</div>

I’m sorry claudio… You’re so right 🙂 I forgot to use \_parent.gotoAndPlay(). The button wasn’t in the same level as the movie that should play. Thank you 🙂

Voetsjoeba: Yupp, but it did work not doing your way… 🙂

---

<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 30, 2003, 1:43pm UTC](https://forum.kirupa.com/t/framelabels/27130/8 "2003-07-30T13:43:02Z")

</div>

Two ways are better than one 😉

---

<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 30, 2003, 1:44pm UTC](https://forum.kirupa.com/t/framelabels/27130/9 "2003-07-30T13:44:32Z")

</div>

No problem 😉

---

<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 30, 2003, 1:44pm UTC](https://forum.kirupa.com/t/framelabels/27130/10 "2003-07-30T13:44:38Z")

</div>

Totally correct :thumb: Thanks for your help!
