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 at an SF field" "" "GPAC Regression Tests" "(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 } } ] } Transform2D { translation -150 -120 children [ Shape { appearance DEF APP Appearance { material Material2D { emissiveColor 0 0 0 filled TRUE } } geometry DEF TEXT Text { string ["test node create"] fontStyle FontStyle { family ["SANS"] justify ["BEGIN" "BEGIN"] size 40 style "BOLDITALIC" } } } ] } DEF SCRIPT Script { eventIn SFBool act field SFNode ap USE APP url ["javascript: function act(value, timestamp) {mat = new SFNode('Material2D');if (value) {mat.emissiveColor = new SFColor(1, 0, 0);mat.filled = TRUE;} else {mat.emissiveColor = new SFColor(0, 0, 0);mat.filled = TRUE;}ap.material = mat;}" ] } ] } ROUTE TS.isActive TO SCRIPT.act