Take a numeric data entry field. By default, a numeric variable named “NumericEntry” is created.
Create a text variable named “textvalue” and set the default value as empty.
Let’s now look at the purpose of each line of code.
var player=GetPlayer(); is for extracting the properties of the Player.
varNumericEntry=NumericEntry.toFixed(3); is for fixing the decimal points. Here I’ve taken 3 decimal points.
vartxtvalue=NumericEntry.toString(); is for converting the numeric value to a string format.
player.SetVar(“textvalue”, txtvalue); is for passing the variable to Storyline.
Now display the value of the text variable (“textvalue”) by placing the text “textvalue” between two “%” symbols.
Publish your Storyline file and check the magical output.
Subscribe to Our Blogs
Get CommLab's latest eLearning articles straight to your inbox. Enter your email address below: