script
DEF script Script {
directOutput TRUE
eventIn SFTime touch
field SFNode text USE monitor
field SFInt32 toggle 0
field MFString string1 [ "message 1:" "this is a cube" ]
field MFString string2 [ "message 2:" "it rotates" ]
field MFString string3 [ "message 3:" "more information?" ]
url "vrmlscript:
function touch(value) {
toggle += 1;
if (toggle == 1) text.string = string1;
else if (toggle == 2) text.set_string = string2;
else if (toggle == 3) text.set_string = string3;
if (toggle == 3) toggle=0;
}"
} ## end script