You are not logged in.

1

Sunday, October 4th 2009, 10:53pm

Preview with SWFobject embedding (not XML)

Is it possible to specify a preview (sphere) image as a SWFobject parameter, in the same way you can specify a sphere image?

Source code

1
2
3
4
 swfobject.embedSWF("krpano.swf", "pano",  "960", "480", "9.0.28",  "/js/swfobject/expressInstall.swf", 
                        	{pano:"krpano.xml", sphere:"equi.jpg"}, 
                        	{allowfullscreen:true, bgcolor:"#ffffff", allowscriptaccess: 'sameDomain'}, 
                        	{id:'pano', name:'pano'});


What's the parameter name? Is there a way of converting from XML params to JS params?

2

Monday, October 5th 2009, 11:56am

Hi,

yes, that's possible,

Source code

1
What's the parameter name? Is there a way of converting from XML params to JS params? 


the conversion works in this way:
e.g. this xml:

Source code

1
2
3
<note1>
  <node2 attribute="value" />
</node>

will become to:

Source code

1
node1.node2.attribute=value


so this:

Source code

1
2
3
<krpano>
  <preview type="SPHERE" url="preview.jpg" />
</krpano>


will become to:

Source code

1
2
krpano.preview.type=SPHERE
krpano.preview.url=preview.jpg


but to reduce the length the variable path the "krpano." can be removed,
so just this will be enougth:

Source code

1
2
preview.type=SPHERE
preview.url=preview.jpg


note - when using krpano 1.0.8 beta 8 - the 'type' of the preview don't need to be set, it will be detected automatically,
so this should be finally enough:

Source code

1
preview.url=preview.jpg



and in swfobject 2.1 syntax:

Source code

1
2
3
4
swfobject.embedSWF("krpano.swf", "pano",  "960", "480", "9.0.28",  "/js/swfobject/expressInstall.swf", 
              {pano:"krpano.xml", sphere:"equi.jpg", "preview.url"="preview.jpg"}, 
              {allowfullscreen:true, bgcolor:"#ffffff", allowscriptaccess: 'sameDomain'}, 
              {id:'pano', name:'pano'});


best regards,
Klaus

3

Monday, October 5th 2009, 9:07pm

Thank you, that's great.

I saw this syntax in the manual but thought it applied to AS3 rather than JS embedding.