- Umajin App Creator downloaded and installed
- Any text editor
- Completed the registerAction tutorial
Pro Tip: using Visual Studio Code as your editor will allow you to integrate debugging.
Step 1) Create a new blank app in the Umajin App Creator to use as a testing platform for our property altering platform.
File → Open Resources Folder → scripts.
NOTE: In order for this Component to be available for use, simply reload the page.
Step 4) Now we will write the function that will correspond to this Action. First, though, we will set the Global Variable that we will have the key “name” to the name, “Carolyn”. Now we can write a very simple function that will take in the Text Component as well as the provided string. The line of code within the function sets the Text Property of the Text Component to that of whatever we input into the Umajin platform.
var name = "Carolyn";
Step 5) Go into your Umajin platform and set up your page for testing. Ours will be very simple, as only a Text Component and a Button Component are required.
Step 7) Use the drop down menu beside the text label to select your desired Text Component. This will be the Component onto which our Global Variable “name” is mapped. Now we will choose the string to have displayed. To test this out, feel free to put any string into the text entry panel and see that it is displayed with the press of your button.
To display the value of the Global Variable, put the key associated (aka the name of the variable) in square brackets.
Step 8) Test out your Global Variable display feature! Ours looks like this: