docs: private void BuildInitJavaScript(InteractiveObject interactiveObject) {
          String gearVRinitJavaScript = "function " + GEARVR_INIT_JAVASCRIPT_FUNCTION_NAME + "()\n{\n";
  
          //The first two arguments are for the event - could be time or an isOver/isActive boolean -
          // and the second argument is for the timeStamp which is the accumulated time for starting
          // the per Frame calls to JavaScript, or 0 for isOver/isActive touch events
          ScriptObject scriptObject = interactiveObject.getScriptObject();
          int argumentNum = 1;
          if (scriptObject.getTimeStampParameter()) argumentNum = 2;
          if ( interactiveObject.getSensor() != null ) {
              if ( interactiveObject.getSensor().getSensorType() == Sensor.Type.PLANE) {
                  argumentNum = 2;
              }
              else if ( interactiveObject.getSensor().getSensorType() == Sensor.Type.CYLINDER) {
                  argumentNum = 4;
              }
              else if ( interactiveObject.getSensor().getSensorType() == Sensor.Type.SPHERE) {
                  argumentNum = 4;
              }
          }
  
          // Get the parameters on X3D data types that are included with this JavaScript
          if ( V8JavaScriptEngine ) {
              for (ScriptObject.Field field : scriptObject.getFieldsArrayList()) {
                  String fieldType = scriptObject.getFieldType(field);
                  if (scriptObject.getFromDefinedItem(field) != null) {
                      if ((fieldType.equalsIgnoreCase("SFColor")) || (fieldType.equalsIgnoreCase("SFVec3f"))) {
                          gearVRinitJavaScript += scriptObject.getFieldName(field) + " = new " + scriptObject.getFieldType(field) +
                                  "( params[" + argumentNum + "], params[" + (argumentNum + 1) + "], params[" + (argumentNum + 2) + "]);\n";
                          argumentNum += 3;
                      }  // end if SFColor of SFVec3f, a 3-value parameter
                      else if (fieldType.equalsIgnoreCase("SFRotation")) {
                          gearVRinitJavaScript += scriptObject.getFieldName(field) + " = new " + scriptObject.getFieldType(field) +
                                  "( params[" + argumentNum + "], params[" + (argumentNum + 1) + "], params[" + (argumentNum + 2)
                                  + "], params[" + (argumentNum + 3) + "]);\n";
                          argumentNum += 4;
                      }  // end if SFRotation, a 4-value parameter
                      else if (fieldType.equalsIgnoreCase("SFVec2f")) {
                          gearVRinitJavaScript += scriptObject.getFieldName(field) + " = new " + scriptObject.getFieldType(field) +
                                  "( params[" + argumentNum + "], params[" + (argumentNum + 1) + "]);\n";
                          argumentNum += 2;
                      }  // end if SFVec2f, a 2-value parameter
  
                      else if ((fieldType.equalsIgnoreCase("SFFloat")) || (fieldType.equalsIgnoreCase("SFBool"))
                              || (fieldType.equalsIgnoreCase("SFInt32")) || (fieldType.equalsIgnoreCase("SFTime")) ) {
                          gearVRinitJavaScript += scriptObject.getFieldName(field) + " = new " + scriptObject.getFieldType(field) +
                                  "( params[" + argumentNum + "]);\n";
                          argumentNum += 1;
                      }  // end if SFFloat, SFBool, SFInt32 or SFTime - a single parameter
                      else if (fieldType.equalsIgnoreCase("SFString") ) {
                          gearVRinitJavaScript += scriptObject.getFieldName(field) + " = new " + scriptObject.getFieldType(field) +
                                  "( params[" + argumentNum + "]);\n";
                          argumentNum += 1;
                      }  // end if SFString
                      else if (fieldType.equalsIgnoreCase("MFString") ) {
                          // TODO: need MFString to support more than one argument due to being used for Text Strings
                          gearVRinitJavaScript += scriptObject.getFieldName(field) + " = new " + scriptObject.getFieldType(field) +
                                  "( params[" + argumentNum + "]);\n";
                          argumentNum += 1;
                      }  // end if MFString
                      else {
                          Log.e(TAG, "Error unsupported field type '" + fieldType + "' in SCRIPT '" +
                                  interactiveObject.getScriptObject().getName() + "'");
                      }
                  }
                  else if (scriptObject.getFromEventUtility(field) != null) {
                      if (fieldType.equalsIgnoreCase("SFBool")) {
                          gearVRinitJavaScript += scriptObject.getFieldName(field) + " = new " + scriptObject.getFieldType(field) +
                                  "( params[" + argumentNum + "]);\n";
                          argumentNum += 1;
                      }  // end if SFBool
                  }  //  end scriptObject.getFromEventUtility(field) != null
                  else if (scriptObject.getFromTimeSensor(field) != null) {
                      if (fieldType.equalsIgnoreCase("SFFloat")) {
                          gearVRinitJavaScript += scriptObject.getFieldName(field) + " = new " + scriptObject.getFieldType(field) +
                                  "( params[" + argumentNum + "]);\n";
                          argumentNum += 1;
                      }  // end if SFFloat
                  }  //  end scriptObject.getFromTimeSensor(field) != null
              }  // for loop checking for parameters passed to the JavaScript parser
          }  //  end if V8 engine
          else {
              // Mozilla Rhino engine
              for (ScriptObject.Field field : scriptObject.getFieldsArrayList()) {
                  String fieldType = scriptObject.getFieldType(field);
  
                  if (scriptObject.getFromDefinedItem(field) != null) {
                      if ((fieldType.equalsIgnoreCase("SFColor")) || (fieldType.equalsIgnoreCase("SFVec3f"))) {
                          gearVRinitJavaScript += scriptObject.getFieldName(field) + " = new " + scriptObject.getFieldType(field) +
                                  "( arg" + argumentNum + ", arg" + (argumentNum + 1) + ", arg" + (argumentNum + 2) + ");\n";
                          argumentNum += 3;
                      }  // end if SFColor of SFVec3f
                      else if (fieldType.equalsIgnoreCase("SFRotation")) {
                          gearVRinitJavaScript += scriptObject.getFieldName(field) + " = new " + scriptObject.getFieldType(field) +
                                  "( arg" + argumentNum + ", arg" + (argumentNum + 1) + ", arg" + (argumentNum + 2)
                                  + ", arg" + (argumentNum + 3) + ");\n";
                          argumentNum += 4;
                      }  // end if SFRotation
  
                      else if ((fieldType.equalsIgnoreCase("SFFloat")) || (fieldType.equalsIgnoreCase("SFBool"))) {
                          gearVRinitJavaScript += scriptObject.getFieldName(field) + " = new " + scriptObject.getFieldType(field) +
                                  "( arg" + argumentNum + ");\n";
                          argumentNum += 1;
                      }  // end if SFFloat or SFBool
                  }  //  end scriptObject.getFromDefinedItem(field) != null
                  else if (scriptObject.getFromEventUtility(field) != null) {
                      if (fieldType.equalsIgnoreCase("SFBool")) {
                          gearVRinitJavaScript += scriptObject.getFieldName(field) + " = new " + scriptObject.getFieldType(field) +
                                  "( arg" + argumentNum + ");\n";
                          argumentNum += 1;
                      }  // end if SFBool
                  }  //  end scriptObject.getFromEventUtility(field) != null
                  else if (scriptObject.getFromTimeSensor(field) != null) {
                      if (fieldType.equalsIgnoreCase("SFFloat")) {
                          gearVRinitJavaScript += scriptObject.getFieldName(field) + " = new " + scriptObject.getFieldType(field) +
                                  "( arg" + argumentNum + ");\n";
                          argumentNum += 1;
                      }  // end if SFFloat
                  }  //  end scriptObject.getFromTimeSensor(field) != null
  
              }  // for loop checking for parameters passed to the JavaScript parser
          }  // end if Mozilla Rhino engine
          gearVRinitJavaScript += "}";
          scriptObject.setGearVRinitJavaScript(gearVRinitJavaScript);
      }