# Get information out of a inputfield

**URL:** https://forum.kirupa.com/t/get-information-out-of-a-inputfield/331037
**Category:** flash
**Created:** [May 1, 2013, 12:00pm UTC](https://forum.kirupa.com/t/get-information-out-of-a-inputfield/331037 "2013-05-01T12:00:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Enza89](https://avatars.discourse-cdn.com/v4/letter/e/e95f7d/32.png) [@Enza89](https://forum.kirupa.com/u/Enza89)
#### Post date: [May 1, 2013, 12:00pm UTC](https://forum.kirupa.com/t/get-information-out-of-a-inputfield/331037/1 "2013-05-01T12:00:04Z")

</div>

Hello,

I am building a prototype of a little game and I’m having trouble to make it work.  
The game has to work the following:  
The player clicks an object and a input field is enabled.  
The player fills in the right word in the field and the object disappears (visibility is false).

Below is the code I wrote.  
I need to see if the text in the input field is wrong or right. If it is right the objects visibility is set to false otherwise it stays true.  
\*EDIT: I don’t get any errors, but the object doesn’t disappear.

```auto
import flash.events.MouseEvent;
import flash.ui.Keyboard;

stop();

uitleg_mc.visible = false;
olifantje_mc.visible = false;

stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyEnter);
help_mc.addEventListener(MouseEvent.CLICK, openUitleg);
olifant_mc.addEventListener(MouseEvent.CLICK, olifantje);

function openUitleg (e:MouseEvent) {
    if (uitleg_mc.visible == false){
        uitleg_mc.visible = true;        
    }
    else{
        uitleg_mc.visible = false;
    }
}

function olifantje (e:MouseEvent) {
    olifantje_mc.visible=true;
}

function onKeyEnter (e:KeyboardEvent){
        
    if (olifantje_mc.text == 'olifantje'){
        olifant_mc.visible=false;
    }
    else {
        olifant_mc.visible=true;
    }
    }

```

Hopefully this is clear and someone can help me 😉
