# Set Variable As Label?

**URL:** <https://forum.kirupa.com/t/set-variable-as-label/6852>\
**Category:** flash\
**Created:** [October 17, 2002, 7:25pm UTC](https://forum.kirupa.com/t/set-variable-as-label/6852 "2002-10-17T19:25:04Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![earph](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/earph/32/79_2.png) [@earph](https://forum.kirupa.com/u/earph)\
**Post date:** [October 17, 2002, 7:25pm UTC](https://forum.kirupa.com/t/set-variable-as-label/6852/1 "2002-10-17T19:25:04Z")

</div>

I’d like my button to set a variable, then play the rest of the frames. On the last frame I want it to jump to a label.

Can you set variables to labels?

I’ve got this on my button:

on (release) {  
set(whereNext, dictate);  
play();  
}

Then in the last frame I have:

gotoAndPlay(dictation);

But it’s not working. How might I accomplish this?

---

<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:** [October 17, 2002, 7:28pm UTC](https://forum.kirupa.com/t/set-variable-as-label/6852/2 "2002-10-17T19:28:20Z")

</div>

um… one is dictate, one is dictation?

also… wherenext is the variable name and dictate is supposed to be the expression

so, it would make more sense if it was

gotoandplay(wherenext);

---

<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:** [October 17, 2002, 7:33pm UTC](https://forum.kirupa.com/t/set-variable-as-label/6852/3 "2002-10-17T19:33:12Z")

</div>

alright… I caught all that, but it’s still not working.

it plays to the last frame where this code is:

gotoAndPlay(dictation);

But instead of going there, it just keeps playing down the timeline

---

<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:** [October 17, 2002, 7:57pm UTC](https://forum.kirupa.com/t/set-variable-as-label/6852/4 "2002-10-17T19:57:13Z")

</div>

There is a problem with gotoAndPlay(variable) that has been solved by the guys at flashcoders (surprising…). Just put this.gotoAndPlay(variable). Dunno why but it works.

pom 😏

---

<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:** [October 17, 2002, 8:00pm UTC](https://forum.kirupa.com/t/set-variable-as-label/6852/5 "2002-10-17T20:00:10Z")

</div>

.gotoAndPlay(variable) ?

---

<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:** [October 17, 2002, 8:24pm UTC](https://forum.kirupa.com/t/set-variable-as-label/6852/6 "2002-10-17T20:24:21Z")

</div>

😛 this.gotoAndPlay(yourVariable)

---

<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:** [October 17, 2002, 8:28pm UTC](https://forum.kirupa.com/t/set-variable-as-label/6852/7 "2002-10-17T20:28:24Z")

</div>

Can you set a variable go to a frame label?

---

<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:** [October 17, 2002, 8:32pm UTC](https://forum.kirupa.com/t/set-variable-as-label/6852/8 "2002-10-17T20:32:38Z")

</div>

Nevermind… I got it working now… Thanks for all the 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:** [October 18, 2002, 7:55pm UTC](https://forum.kirupa.com/t/set-variable-as-label/6852/9 "2002-10-18T19:55:03Z")

</div>

’ this ’ works well… is there another one I could use for a ’ child ’ MC?

What would be the eqivalent of ’ \_level2 '?

---

<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:** [October 18, 2002, 10:55pm UTC](https://forum.kirupa.com/t/set-variable-as-label/6852/10 "2002-10-18T22:55:12Z")

</div>

What do you mean?

---

<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:** [October 21, 2002, 2:43pm UTC](https://forum.kirupa.com/t/set-variable-as-label/6852/11 "2002-10-21T14:43:28Z")

</div>

ah… thanks, but I figured it out. I was putting my coordinates in the wrong place. And… I was needing to use \_level0…
