Well that didn't work for me. I tried a bunch of permutations with "faking" a touch/click and used a bunch of jquery stuff. None of it worked
But I found a work around for it if anybody is interested. Here's my xml file:
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
<action name="startup">
<!-- load the first scene -->
loadscene(get(scenename), null, MERGE);
oninterrupt(break);
set(continuespinning,true);
spinloop();
</action>
<action name="spinloop">
oninterrupt(break);
add(hlookattemp,get(view.hlookat),5);
lookto(get(hlookattemp), get(view.vlookat), get(view.fov), linear(10));
if(continuespinning,spinloop())
</action>
|
Basically, i set a boolean to true, then it loops through the spin loop function adding 5 degrees to the hlookat value everytime. So, now, all I need to do is to kill that boolean and it will stop spinning. It doesn't *technically* stop spinning when it's called, it finishss it's current 5 degree animation and then stops. But those 5 degree movements take a fraction of a second anyway, so it's pretty negligable. Then the javascript stuff is really simple:
|
Quellcode
|
1
2
3
4
5
6
7
8
9
|
function play(){
document.getElementById("krpanoSWFObject").set('continuespinning','true');
document.getElementById("krpanoSWFObject").call('spinloop()');
$('#playpause').html('play | <a href="#" onclick="pause();return false;">pause</a>');
}
function pause(){
document.getElementById("krpanoSWFObject").set('continuespinning','false');
$('#playpause').html('<a href="#" onclick="play();return false;">play</a> | pause');
}
|
The two functions just set the boolean "continuespinning" and then play will call that looping function. This seems to be a pretty good way of controlling spinning/animation via javascript without having control of a "kill process" function for the animation.