Hi,
I was encountering a problem that I will detail bellow.
On idle event, I start to run an autorotation (through different positions).
These positions are defined by "scenepoint" elements in the XML.
The script tweens hlookat, vlookat and fov and when the timer is out, it tweens to the next position.
This codes works very well when there is no scene loading.
Here is the code :
<events onmousedown="interruptScenarisation();" onidle="startScenarisation(2);"/>
<scenepoint name="0" hlookat="-11.017794260712362" vlookat="21.05284355560385" fov="65" duration="5"/>
<scenepoint name="1" hlookat="-16.305193406347982" vlookat="9.227443530720548" fov="50" duration="5"/>
<action name="scenarisationEnd">
startScenarisation();
</action>
<action name="startScenarisation">
set(scenarisation_running,true);
wait(blend);
set(idletime,3);
mod(view.hlookat,get(view.hlookat),360);
goToScenePoint(0,%1);
</action>
<action name="interruptScenarisation">
set(scenarisation_running,false);
stoptween(view.hlookat,view.vlookat,view.fov);
</action>
<action name="goToScenePoint">
add(next_index,%1,1);
if (next_index GT %2,scenarisationEnd(),
mul(duration,get(scenepoint[%1].duration),1);
goToPosition(get(scenepoint[%1].hlookat),get(scenepoint[%1].vlookat),get(scenepoint[%1].fov),
get(duration),linear,goToScenePoint(get(next_index),%2));
);
</action>
<action name="goToPosition">
tween(view.hlookat,%1,%4,%5);
tween(view.vlookat,%2,%4,%5);
tween(view.fov,%3,%4,%5,%6);
</action>
Alles anzeigen
But when I try to load a scene by a click on a thumbnail, the stoptweens doesn't work.
Even when I call interruptScenarisation() at the beginning of startScenarisation().
Here is the scene loading code.
I try to make a wait(1) at the beginning of startScenarisation() but I have still the same problem.
The only way I have found to stop the tween is to make a mousedown event (calling interruptScenarisation() before clicking on the thumbnail).
If anyone has a solution...
Thank you