I want to make a text box that if you type something in it and click a button something will happen. how can I do that? I know the code should be in the button and look something like this (if (editbox=hidemonkey{ monkey.hide()}).
please help.
Printable View
I want to make a text box that if you type something in it and click a button something will happen. how can I do that? I know the code should be in the button and look something like this (if (editbox=hidemonkey{ monkey.hide()}).
please help.
Hello ConnELITE,
In the Edit Box element properties you will see a spot for 'variable'. In here put the name of a variable. eg. userInput. A variable is used to contain information and allows that information to be retreived and processed at a later time.
Ok, now when someone clicks on the button you can use something like this...
if(userInput=="hidemonkey")
element("monkey").hide();
You need to use '==' when making a comparison otherwise a single '=' will assign "hidemokey" to the variable userInput and the result of which will be 'True' so the monkey element will always be hidden.
Hope this helps.
oh i see, thank you very much