# Hmm.. I need some help with a function reading a "password"?

**URL:** <https://forum.kirupa.com/t/hmm-i-need-some-help-with-a-function-reading-a-password/282955>\
**Category:** flash\
**Created:** [February 28, 2009, 7:53am UTC](https://forum.kirupa.com/t/hmm-i-need-some-help-with-a-function-reading-a-password/282955 "2009-02-28T07:53:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maxorz](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Maxorz](https://forum.kirupa.com/u/Maxorz)\
**Post date:** [February 28, 2009, 7:53am UTC](https://forum.kirupa.com/t/hmm-i-need-some-help-with-a-function-reading-a-password/282955/1 "2009-02-28T07:53:26Z")

</div>

Hello! I just started learning flash and actions and stuff so to practice I’m making this little totally random game of a guy that starts playing a guitar and then goes to the space and weird stuff \>\< haha, anyway!

There is this part where there is a door which will only open if you prove that you’ve lost, and there’s a wall with a “imput text” form where you can write and do graffiti, and I want to make it so that if you write “The Game” anywhere on that wall, you will get certain +1 value…

I’ve made something to practice that works kind of like that…

stop();  
graffiti.addEventListener(MouseEvent.CLICK, showStringInfo);

function showStringInfo(Event:MouseEvent):void {  
var myString:String = theText\_txt.text;  
var win:String = “Win”  
var graffitipass: Number = 0;

```
if(myString==win)
{
    gotoAndStop(2);
    graffitypass=1;

}

```

}

So that works with a button, but the thing is that I want to be so that it doesn’t matter weather it is in caps or not, so it would accept “the game” “THE GAME” “ThE GaMe” etc… And also I want it to be so that it doesn’t matter if there’s any other text in the box… And if it would work without a button it’d be even better…  
So I think that it could make a search for the words “the game” and if the search returns true the it would active the if statement…

Also if it can’t be done without a button or anything like that, that’s okay. 😛

Thanks 🙂
