You are not logged in.

1

Friday, April 10th 2009, 11:21am

Javascript "onstart"

Hi all,

How can i convert the "function" onstart of the xml:

Source code

1
<krpano version="1.0.8" onstart="set(krpano.autorotate.enabled,true)"> 


to javascript addVariable:

Source code

1
2
3
4
5
6
7
8
9
10
11
var so = new SWFObject("krpano.swf", "krpanoSWFObject", "100%", "100%", "9.0.28","#000000"); 
so.addParam("allowFullScreen","true"); 
so.addVariable("sphere", "1.jpg"); 
so.addVariable("image.type","SPHERE"); 
so.addVariable("image.hfov","360"); 
so.addVariable("image.voffset","5"); 
so.addVariable("krpano.autorotate.enabled","true"); 
so.addVariable("krpano.autorotate.waittime","0"); 
so.addVariable("krpano.autorotate.speed","50"); 
so.addVariable("krpano.autorotate.accel","1.5"); 
so.addVariable("krpano.onstart","??");


Or what's the best way to start autorotate pano in a javascript scenario?

Thanks,
myky

2

Friday, April 10th 2009, 7:09pm

Hi,

the "krpano." prefix is not needed,
it will also without it,

Quoted

Or what's the best way to start autorotate pano in a javascript scenario?

both ways are possible:

Source code

1
so.addVariable("autorotate.enabled","true"); 

or

Source code

1
so.addVariable("onstart","set(autorotate.enabled,true);"); 


choose the one you like more

best regards,
Klaus

3

Friday, April 10th 2009, 7:13pm

Thanks Klaus, that solved my problem!!