Functions in Hype xAPI
hypeDocument

hypeDocument.runExpression

1min

The hypeDocument.runExpression function allows you to run a JavaScript expression in the context of an object. The expression is evaluated in the context of the object, and the result is returned. The most common use for this function is to run a JavaScript expression in the context of a hypeDocument. This allows you to access and modify the document's data, including its timeline and scene data. For example, you could use hypeDocument.runExpression to do a calculation:

JS


The variable c would be looked up in the hypeDocument's context and would be set to the result of the calculation. Make sure to predeclare any variables you plan to use in your expression, otherwise they will not be accessible.

Hence, that this function mainly exists to provide the GUI version and mirror the functionality in code.