variables with text entry help

Feb 23, 2024

Hi. I am not sure if what I am asking is possible. The user is supposed to type the number 68 into an input box. Once they type that number, I want a red lined shape to appear around another area of the screen , but only if 68 has been typed. I don't want the user to have to click anywhere once the 68 has been typed. As soon as the 8 is typed, the other rectangle shape should appear. Thanks.

3 Replies
Brian Dennis

Triggers do not fire on individual keystrokes, but I was able to get close to your ask. I created a variable called "entered", connect a text input to that variable, then show the "redbox" layer using a Show Layer trigger with conditions [when variable changes; entered == 68] . The layer shows only after ENTER.

Nathanial Hilliard

April, Brian's solution will probably do what you want.

However, if anyone wants to trigger something directly from the value you type into an input text box, then you can do something like this. In the example, as you type into the box, the current value is displayed. When it matches the target value that you set, the red box is triggered. No pressing enter or clicking required. 

https://360.articulate.com/review/content/35f36820-20f1-4e4e-ab5b-97b9342f490e/review

It uses a small piece of JavaScript to "listen" for changes to the input box's contents. It doesn't need to have them committed before it can respond. The event listener is only active when the input box has focus.