InitialObjectDescriptor {
 objectDescriptorID 1
 audioProfileLevelIndication 255
 visualProfileLevelIndication 254
 sceneProfileLevelIndication 1
 graphicsProfileLevelIndication 1
 ODProfileLevelIndication 1
 esDescr [
  ES_Descriptor {
   ES_ID 1
   decConfigDescr DecoderConfigDescriptor {
    streamType 3
    decSpecificInfo BIFSConfig {
     isCommandStream true
     pixelMetric true
     pixelWidth 600
     pixelHeight 400
    }
   }
  }
 ]
}

OrderedGroup {
 children [
  Background2D {
   backColor 1 1 1
  }
  WorldInfo {
   info ["This shows script creating a new node in an MF field" "" "GPAC Regression Tests" "$Date: 2007-07-27 09:46:10 $ - $Revision: 1.2 $" "(C) 2002-2004 GPAC Team"]
   title "Script Node Creation test"
  }
  Transform2D {
   children [
    DEF TS TouchSensor {}
    Shape {
     appearance Appearance {
      material DEF MAT Material2D {
       emissiveColor 1 0 0
       filled TRUE
      }
     }
     geometry Rectangle {
      size 50 50
     }
    }
   ]
  }
  DEF TR Transform2D {
   translation -150 -120
  }
  DEF SCRIPT Script {
   eventIn SFBool act
   field SFNode t USE TR
   url ["javascript: function act(value, timestamp) {if (!value) return;t.children[0] = new SFNode('Shape');t.children[0].geometry = new SFNode('Rectangle');t.children[0].geometry.size = new SFVec2f(100, 50);t.children[0].appearance = new SFNode('Appearance');t.children[0].appearance.material = new SFNode('Material2D');t.children[0].appearance.material.filled = true;t.children[0].appearance.material.emissiveColor = new SFColor(0, 0, 1);}"   ]
  }
 ]
}

ROUTE TS.isActive TO SCRIPT.act

