Class Script

java.lang.Object
All Implemented Interfaces:
X3DChildNode, X3DNode, X3DUrlObject, Script, X3DScriptNode

public class Script extends X3DConcreteNode implements Script
Script contains author-programmed event behaviors for a scene.

Warning: this is an abstract interface that cannot be instantiated as a concrete object. Java programmers typically only need to use concrete objects provided by the org.web3d.x3d.jsail classes. Script node tooltip: [X3DScriptNode] Script contains author-programmed event behaviors for a scene. Define the script input-output event interface by including <field/> elements. Scripting code is embedded in a child CDATA node or (deprecated) in the url field. Optionally supported programming languages are ECMAScript (JavaScript) and Java (via url to a myNode.class file).
  • Hint: insert an XML Character Data (CDATA) block within the Script node to contain source code embedded within an X3D scene, avoiding the need for escape characters.
  • Hint: a contained XML Character Data (CDATA) block for source code protects whitespace, line breaks, and literal characters (such as & for ampersand character, < for less-than-sign character, and > for greater-than-sign character) from unintended escape-character modifications by XML parsers.
  • Warning: strict order is required for contained constructs: first field declarations (if any), then IS/connect statements (if any), and finally CDATA source-code block.
  • Hint: X3D Scene Authoring Hints, Scripts https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Scripts
  • Hint: apply containerField='watchList' when parent node is LoadSensor.ECMAScript-262 specification http://www.ecma-international.org/publications/standards/Ecma-262.htm
  • Hint: embedded ecmascript: source can also be contained in the sourceCode pseudo-field without escape characters, equivalent to last entry in the url list, when using other API codebases and file encodings.

Package hint: This org.web3d.x3d.jsail concrete class is used for implementing a standalone X3D object as a Plain Old Java Object (POJO). If you are writing Java code for use inside an X3D Script node, compile separate code using only the org.web3d.x3d.sai package instead.
See Also: