#VRML V2.0 utf8 Viewpoint { position 5 0 20 } Shape { geometry DEF texto Text { string ["Press the button..."] length [] maxExtent 0.0 } } DEF t1 Transform { translation -2 0 0 children [ Shape {geometry Box{size 0.5 0.5 0.5}} DEF ts TouchSensor {} ] } DEF t2 Transform { translation 0 3 0 children [] } DEF bi1 Script { eventIn SFBool pressed eventOut MFString outS eventOut MFNode outN url "javascript: function pressed(value,timeStamp) { outN = Browser.createVrmlFromString('Shape{geometry Sphere{}}'); }" } ROUTE ts.isActive TO bi1.pressed ROUTE bi1.outS TO texto.set_string ROUTE bi1.outN TO t2.addChildren