Good afternoon,
We've got a problem with using ECMAScript inside OpenVrml control.
Listed below example shows this problem. The 'TimeSensor' node after activation has to call method 'act' and change value of field 'loop'. But it doesn't happen and no one exception is throwed.
So we've got a question, what is wrong in this situation?
---------------------------------
#VRML V2.0 utf8
Group
{
children
[
DEF ts0 TouchSensor
{
}
Shape
{
appearance Appearance {
material DEF m1 Material {
emissiveColor 0.8 0 0
transparency 0.5
}
}
geometry Sphere {
}
}
]
}
DEF colorInt0 ColorInterpolator { key [ 0 0.25 0.5 0.75 1 ] keyValue [1 0 0, 0 1 0, 1 0 0, 0 1 0, 1 1 1]}
DEF timer0 TimeSensor { cycleInterval 1 startTime 0 loop FALSE }
DEF SCRIPT Script
{
eventIn SFTime act
field SFNode timer0 USE timer0
url "javascript:
function act(active)
{
timer0.loop = TRUE;
}
"}
ROUTE ts0.touchTime TO SCRIPT.act
ROUTE colorInt0.value_changed TO m1.set_diffuseColor
ROUTE timer0.fraction_changed TO colorInt0.set_fraction ROUTE ts0.touchTime TO timer0.set_startTime
|