# Text boxes and Conditional Statements

**URL:** <https://forum.kirupa.com/t/text-boxes-and-conditional-statements/212178>\
**Category:** flash\
**Created:** [January 9, 2007, 1:29am UTC](https://forum.kirupa.com/t/text-boxes-and-conditional-statements/212178 "2007-01-09T01:29:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashermx](https://avatars.discourse-cdn.com/v4/letter/f/e5b9ba/32.png) [@flashermx](https://forum.kirupa.com/u/flashermx)\
**Post date:** [January 9, 2007, 1:29am UTC](https://forum.kirupa.com/t/text-boxes-and-conditional-statements/212178/1 "2007-01-09T01:29:02Z")

</div>

I have attached two flash files. In the first file there is a input text filed that asks for the password. If the password is correct go to a frame, if it is incorrect go to another frame. In this case the text box must have a variable name and I need to refer to the box as such:

on(release){  
if (NameofTextBox.text ==“33”) {  
gotoAndStop(10);  
} else {  
gotoAndStop(5);  
}  
}

In the other file I ask a question and if the text answer is correct play a movie, if it is incorrect play a different. In this case I can rever to the text box as a variable. As below:

on (release){  
if (NameofTextBox==“72”) {  
setProperty(“wronganswertwo”,\_alpha,0);  
rewardtwo.play();  
} else {

```
	setProperty("wronganswertwo",_alpha,100);
wronganswer.play();

```

}  
}

The first file must be an instance name for the text box and no other way. The second file can be both ways. Howcome? These file were both created on a Mac OS 10.

Any help would be appreciated.
