<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<![CDATA[
ecmascript: function initialize () { DEBUG = true; mode = 1; if (DEBUG) Browser.print ('initialize ():'); changedText = new MFString ( 'EcmaScript initialize () with eventOut control', 'has reinitialized the changedText node.', '', 'Please click text for additional results.'); changedPosition = new SFVec3f ( 0, 3, 0 ); changedColor = new SFColor ( 0.8, 0.8, 0.2 ); if (DEBUG) Browser.print ('changedText =' + changedText); if (DEBUG) Browser.print ('changedPosition =' + changedPosition); if (DEBUG) Browser.print ('changedColor =' + changedColor); } function startTime (value, timestamp) { if (DEBUG) Browser.print ('=============================='); if (DEBUG) Browser.print ('touchEvent startTime =' + value); mode = (mode + 1) % 3; if (DEBUG) Browser.print ('mode =' + mode); switch (mode) { case 0: // pre-initialize error messsage changedText = new MFString ( 'Default text in X3D scene will be replaced by', 'EcmaScript initialize() in Script using EventOut control.', 'This text appears first, if EcmaScript initialization fails.', ''); changedPosition = new SFVec3f ( 0, 1, 0 ); changedColor = new SFColor ( 0.8, 0.2, 0.2 ); break; case 1: // post-initialize ready-to-click message initialize (); break; case 2: // post-click all-done message changedText = new MFString ( 'User click on text seen by EcmaScript', 'function via Script node eventIn.', 'Text & position successfully changed', 'via EventOut control. Test passed.'); changedPosition = new SFVec3f ( 0, -1, 0 ); changedColor = new SFColor ( 0.2, 0.8, 0.2 ); break; } if (mode != 1) { if (DEBUG) Browser.print ('changedText =' + changedText); if (DEBUG) Browser.print ('changedPosition =' + changedPosition); if (DEBUG) Browser.print ('changedColor =' + changedColor); if (DEBUG) Browser.print (); } } function shutdown() { if (DEBUG) Browser.print ('=============================='); if (DEBUG) Browser.print ('script shutdown.'); if (DEBUG) Browser.print ('=============================='); }
]]>
<!--
Color key:
<X3dNode
DEF='idName' field='value'/>
matches
<XmlElement
DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources and X3D Scene Authoring Hints. -->