# Using Switch

**URL:** <https://forum.kirupa.com/t/using-switch/270700>\
**Category:** flash\
**Created:** [September 12, 2008, 2:49pm UTC](https://forum.kirupa.com/t/using-switch/270700 "2008-09-12T14:49:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodg](https://avatars.discourse-cdn.com/v4/letter/r/0ea827/32.png) [@rodg](https://forum.kirupa.com/u/rodg)\
**Post date:** [September 12, 2008, 2:49pm UTC](https://forum.kirupa.com/t/using-switch/270700/1 "2008-09-12T14:49:39Z")

</div>

I am trying to use switch in a program I’m creating.

I want the user to enter a word into an input box then have the used click on a button. Depending on the input the program will go to another frame, i have used the following code but can’t get it to work.

Note: input box has Var = input

on (release) {  
switch (input) {  
case 0:  
gotoandstop(3); break ;  
case 2:  
gotoandstop(4); break ;  
case 4:  
gotoandstop(5); break ;  
case 8:  
gotoandstop(6); break ;  
default:  
gotoandstop(7) ;  
}  
}

always goes to the default.

Any assistance would be greatly appreciated

Regards Rod
