Titania X3D Editor

Bring Colours to Your Life.

Titania v4.6.10

Bring Colours to Your Life.

X3D Reference



Script provides programmed behavior for a scene. Define the script interface with <field> elements. Scripting code is embedded in a child CDATA node or (deprecated) in the url field. Optionally supported programming languages: ECMAScript (JavaScript) and (via url to a myNode.class file) Java.

The Script node belongs to the Scripting component and its container field is children. It is available since X3D version 3.0 or later.


* Derived from multiple interfaces.


SFNode [in, out] metadata NULL [X3DMetadataObject]

Metadata are not part of the X3D world and not interpreted by the X3D browser, but they can be accessed via the ECMAScript interface.

MFString [in, out] url [ ] [URI]

Points to a script file url. Also (as deprecated alternative to CDATA block) can contain ecmascript: source as a quoted SFString within the url array.


If Script contains both external url reference and internal CDATA source then external url takes precedence, but will fall back to contained CDATA source if no external script is found.


Do not use the ecmascript: protocol prefix within external script files. Replace javascript: or vrmlscript: protocol prefix with ecmascript: for source code embedded within an X3D scene.

See Also

ECMAScript is the ISO standard version of JavaScript. VrmlScript was a subset of JavaScript originally proposed for use with VRML 97. X3D Scene Authoring Hints, urls

SFBool [ ] directOutput FALSE

Set directOutput true if Script has field reference(s) of type SFNode/MFNode, and also uses direct access to modify attributes of a referenced node in the Scene.


Set directOutput true if Script dynamically establishes or breaks ROUTEs. DirectOutput is a browser hint to avoid overoptimizing referenced nodes, since the Script may change their attribute values without ROUTEd events. DirectOutput false means Script cannot modify referenced nodes or change ROUTEs.

SFBool [ ] mustEvaluate FALSE

If mustEvaluate false, then browser may delay sending input events to Script until outputs are needed. If mustEvaluate true, then Script must receive input events immediately without browser delays.


Set mustEvaluate true when sending/receiving values via the network.



  • Insert a CDATA node to contain source code embedded within an X3D scene.
  • CDATA blocks can protect literal characters (such as & < and >) in source code from unintended escape-character modifications by XML parsers.

Browser Compatibility

Titania X_ITE
yes yes

Cookies and other Technologies

By clicking »Accept« or continuing to use the site, you agree to the use of CREATE3000 and third-party cookies and other similar technologies to enhance your browsing experience, analyze and measure your engagement with our content, and provide more relevant ads on CREATE3000 websites and others. Learn more about cookies. You can withdraw your consent at any time.

create3000.de is going to be shut down next year, but we have a new clean and slick web site for you, go to new X_ITE web site, consider updating your X_ITE URL's, or go to new Titania web site or continue reading.