Wednesday, November 12, 2008

The script engine in ITScriptNet V3.0 has been significantly enhanced with the addition of element properties.  This is a new way to control the behavior and appearance of elements on a prompt.  In previous versions, you could set a property using an In-Prompt script.  For example, to set the background color for an element to Red, you could edit the Background Color In-Prompt Script to set a color, like this:

Element Background Color In-Prompt Script:
RGB(255, 0, 0)

If you wanted to change the color at runtime, for example in response to pressing a button, you would instead set the Background Color In-Prompt Script to a user variable.

Element Background Color In-Prompt Script:
@Color@

Then in the button press action, you would set the user variable to the color you want, and refresh the element.

Button Action Script:
@Color@ = RGB(255, 0, 0)
Refresh("Prompt.Element")

This works well, but has the disadvantage that all of the element's Activation scripts run when it is refreshed.

With ITScriptNet V3.0, we have added the ability to set these properties directly.  Now, to change the background color of an element at runtime, you can simlpy set the value:

Button Action Script:
this.element.backgroundcolor = RGB(255, 0, 0)

Almost any element setting can now be set using these properties!

Comments are closed.