# How to name instances of Boolean values

**URL:** <https://forum.kirupa.com/t/how-to-name-instances-of-boolean-values/258035>\
**Category:** flash\
**Created:** [April 20, 2008, 12:42am UTC](https://forum.kirupa.com/t/how-to-name-instances-of-boolean-values/258035 "2008-04-20T00:42:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![setzer9999](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@setzer9999](https://forum.kirupa.com/u/setzer9999)\
**Post date:** [April 20, 2008, 12:42am UTC](https://forum.kirupa.com/t/how-to-name-instances-of-boolean-values/258035/1 "2008-04-20T00:42:01Z")

</div>

Hello, I had a good response on a problem from user jon\_bla on a previous issue where he introduced me to using Boolean values.

My problem is that I want to use Boolean values to create functionality for buttons to allow the movie to skip to specified frames based on which button is pressed.

Currently I have three buttons.

Each button precedes a motion tween that continues for a few frames.

1. I placed the Boolean var like jon\_bla indicated on each button. Each button has the following code:

> 

on(press){  
gotoAndPlay(2);  
var skip:Boolean = new Boolean();  
skip=true;  
}

1. The tween animation begins on frame 2 and ends on frame 10

2. On frame 10 I have the following code in the actions layer:

> 

stop();  
if(skip == true){  
gotoAndPlay(21);  
}

if(skip == true){  
gotoAndPlay(28);  
}

if(skip == true){  
gotoAndPlay(35);  
}

1. Obviously, I realize that this code is incorrect. What I want to know is how to code each button on frame 1 to a different instance of a Boolean value. In other words, I want button 1 to take you to frame 21 after completing the tween, button 2 to take you to frame 28 after completing the tween, and button 3 to take you to frame 35 after completing the tween.

What is the syntax for naming and referencing a Boolean value?
