{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Immersive",
    "@version":"3.3",
    "@xsd:noNamespaceSchemaLocation":"https://www.web3d.org/specifications/x3d-3.3.xsd",
    "JSON schema":"https://www.web3d.org/specifications/x3d-4.0-JSONSchema.autogenerated.json",
    "head": {
        "meta": [
          {
            "@name":"title",
            "@content":"TestScriptInitialization.x3d"
          },
          {
            "@name":"description",
            "@content":"Test ability to perform Script initialize() method using ECMAsript"
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"16 February 2008"
          },
          {
            "@name":"modified",
            "@content":"27 November 2024"
          },
          {
            "@name":"reference",
            "@content":"https://X3dGraphics.com"
          },
          {
            "@name":"reference",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dResources.html"
          },
          {
            "@name":"rights",
            "@content":"Copyright 2006, Daly Realism and Don Brutzman"
          },
          {
            "@name":"subject",
            "@content":"X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/TestScriptInitialization.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../license.html"
          },
          {
            "@name":"translated",
            "@content":"17 April 2026"
          },
          {
            "@name":"generator",
            "@content":"X3dToJson.xslt, https://www.web3d.org/x3d/stylesheets/X3dToJson.html"
          },
          {
            "@name":"reference",
            "@content":"X3D JSON encoding: https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding"
          }
        ]
    },
    "Scene": {
        "-children":[
          { "WorldInfo":
            {
              "@title":"TestScriptInitialization.x3d"
            }
          },
          { "Shape":
            {
              "-geometry":
                { "Text":
                  {
                    "@DEF":"DisplayText",
                    "@string":["waiting for","Script to initialize()..."],
                    "-fontStyle":
                      { "FontStyle":
                        {
                          "@justify":["MIDDLE","MIDDLE"]
                        }
                      }
                  }
                },
              "-appearance":
                { "Appearance":
                  {
                    "-material":
                      { "Material":
                        {
                          "@ambientIntensity":0,
                          "@diffuseColor":[0,0,0],
                          "@emissiveColor":[0,0.398733,1],
                          "@shininess":0.05,
                          "@specularColor":[0.622449,0.622449,0.622449]
                        }
                      }
                  }
                }
            }
          },
          { "Script":
            {
              "@DEF":"Initializer",
              "field": [
                {
                  "@name":"initializeResult",
                  "@accessType":"outputOnly",
                  "@type":"MFString"
                }
              ],
              "#sourceCode":[
"",
"",
"ecmascript:",
"",
"function initialize ()",
"{",
"    scriptName = 'TestScriptInitialization.x3d';",
"    Browser.println ('[' + scriptName + ' initialize() commmenced...]');",
"",
"    initializeResult = new MFString ('Script initialize() OK');",
"",
"    Browser.println ('[...' + scriptName + ' initialize() complete]');",
"}",
"",
""
]
            }
          },
          { "ROUTE":
            {
              "@fromField":"initializeResult",
              "@fromNode":"Initializer",
              "@toField":"string",
              "@toNode":"DisplayText"
            }
          }
        ]
    }
  }
}