NEW! - Develop With JavaScript!

Not familiar with Lua? No problem; now available in Storyboard 8.0 is the ability to script using JavaScript!

A JavaScript callback can be hooked up to a trigger in the same way a Lua callback can. You will notice that a new Action has been added to the Action list:

JavaScript can be used in much the same way Lua can. Two of the most common uses for any script is getting and setting data. Let's take a look at how that would be done in Storyboard using JavaScript.

sb.getValue

function getControlWidth(context) { 
// This will extract the width of the control 'my_control' on the layer 'my_layer' 
 var value = sb.getValue("my_layer.my_control.grd_width"); 
 print("The width of the control is " + value.toString(10));
}

sb.setValue

function sbFunc(context) { 
 // Assign the string 'variable_data' to the application variable 
'variable_name' 
 sb.setValue("variable_name", "variable_data");
}

You can take a look at the full JavaScript API and a high level view of the JavaScript implementation in our docs to learn more.

 

0

Comments

0 comments

Please sign in to leave a comment.

Didn't find what you were looking for?

New post