# Help with code

**URL:** <https://forum.kirupa.com/t/help-with-code/25751>\
**Category:** programming\
**Created:** [July 16, 2003, 5:02am UTC](https://forum.kirupa.com/t/help-with-code/25751 "2003-07-16T05:02:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mikol27](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Mikol27](https://forum.kirupa.com/u/Mikol27)\
**Post date:** [July 16, 2003, 5:02am UTC](https://forum.kirupa.com/t/help-with-code/25751/1 "2003-07-16T05:02:12Z")

</div>

Does anybody know of a way that I can have the “abcd” --code below-- be anything? meaning I want to modify this code so that if any single letter or number (or series of letters or numbers) entered into the Textbox (input box) will then go to “nameentered” and if nothing is put in the box it will go to namemissing, well it does that part. I just don’t want to have to know exactly what letters they are going to put into the input textbox to try to match.

on (press) {  
if (textbox.text.indexOf(“abcd”) != -1) {  
\_root.gotoAndStop(“nameentered”);  
} else {  
\_root.gotoAndStop(“namemissing”);  
}  
}

Thanks in advance,

-M

---

<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 16, 2003, 5:15am UTC](https://forum.kirupa.com/t/help-with-code/25751/2 "2003-07-16T05:15:37Z")

</div>

[AS]  
on(press){  
if(!textbox.length){ // if nothing is typed  
\_root.gotoAndStop(“namemissing”);  
}else{  
\_root.gotoAndStop(“nameentered”);  
}  
}  
[/AS]

---

<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 16, 2003, 2:15pm UTC](https://forum.kirupa.com/t/help-with-code/25751/3 "2003-07-16T14:15:16Z")

</div>

Man, I tell you what…I learn, I learn, I learn. THANKS! I love this stuff.

---

<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 16, 2003, 2:35pm UTC](https://forum.kirupa.com/t/help-with-code/25751/4 "2003-07-16T14:35:50Z")

</div>

no problem, glad your enjoying it

---

<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 16, 2003, 3:06pm UTC](https://forum.kirupa.com/t/help-with-code/25751/5 "2003-07-16T15:06:29Z")

</div>

one thing…what does the ! represent?

---

<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 16, 2003, 3:09pm UTC](https://forum.kirupa.com/t/help-with-code/25751/6 "2003-07-16T15:09:52Z")

</div>

thats the not operator. as in-

if(!textbox.length) is the same as if(textbox.length==false)

It just saves time and energy 🙂

---

<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 16, 2003, 3:12pm UTC](https://forum.kirupa.com/t/help-with-code/25751/7 "2003-07-16T15:12:26Z")

</div>

thanks for clearing that up kartik

---

<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 16, 2003, 3:35pm UTC](https://forum.kirupa.com/t/help-with-code/25751/8 "2003-07-16T15:35:14Z")

</div>

Way cool! Thanks to both of you.
