<div dir="ltr">Hello Patrick,<div><br></div><div>excellent catch. That is a very explicit rule. It does then seem to make BS Contact and freewrl non-conforming to the current spec.</div><div><br></div><div>Of course, there is a good reason that those browsers behave this way. It is hard concept to discover and then deal with that only the value evaluated last will be used to set the actual value and that even ordering is not guaranteed, eg. set_cycleInterval could occur before set_enabled=false.</div><div><br></div><div>-Andreas</div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 21, 2016 at 9:48 AM, Patrick Dähne <span dir="ltr"><<a href="mailto:patrick.daehne@igd.fraunhofer.de" target="_blank">patrick.daehne@igd.fraunhofer.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Andreas,<br>
<br>
Setting the cycleInterval does not work because your example javascript code does not comply with X3D. Have a look at the following lines:<br>
<br>
time.enabled = false;<br>
time.cycleInterval = 5;<br>
time.enabled = true;<br>
<br>
And now have a look at the spec (X3D Language Bindings : ECMAScript (JavaScript), 4.3.5.2.2 Accessing fields and readable fields of other nodes):<br>
<br>
… Events generated by setting an input-capable field on a node are sent at the completion of the initial function call made to the user code by the browser. … Assigning to the inputOnly field multiple times during one execution of the function still only sends one event and that event shall be the last value assigned.<br>
<br>
So in X3D conformant browsers, the lines above send only two events:<br>
<br>
1. time.enabled = true<br>
2. time.cycleInterval = 5<br>
<br>
The first assignment to time.enabled gets overwritten by the second assignment, so the timer never gets disabled.<br>
<br>
Bye,<br>
<br>
Patrick<br>
<br>
<br>
<br>
> Am 20.11.2016 um 21:36 schrieb Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>>:<br>
><br>
> I want to change the cycleTime of a TimeSensor in a x3d script:<br>
><br>
> <a href="https://raw.githubusercontent.com/andreasplesch/cobweb_dom/master/tests/dynamicCycleTime.x3d" rel="noreferrer" target="_blank">https://raw.githubusercontent.<wbr>com/andreasplesch/cobweb_dom/<wbr>master/tests/dynamicCycleTime.<wbr>x3d</a><br>
><br>
> cycleTime input events are ignored when the TimeSensor is enabled. So it is necessary to disable it first, then change the cycleTime and then reenable it.<br>
><br>
> However, in all tested browser the above does not work as expected. These are cobweb, instant player and bs contact. bs contact also has this console message:<br>
> Script node speeder: parse error: line 16 "time.cycleInterval = 2;" ()<br>
> and therefore does not get to change the color to grey.<br>
> The javascript sai does not have a SFTime constructor and allows numbers.<br>
><br>
> cobweb and instant player change the color but do not slow down the ball.<br>
> I first thought that cobweb does not correctly work through the sequence of events but since no browser works sofar I start to think that I am missing something.<br>
><br>
> Any help or feedback appreciated,<br>
><br>
> -Andreas<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div></div></div>