Sie sind nicht angemeldet.

1

Sonntag, 4. Oktober 2009, 22:53

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?

Quellcode

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

Montag, 5. Oktober 2009, 11:56

Hi,

yes, that's possible,

Quellcode

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:

Quellcode

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

will become to:

Quellcode

1
node1.node2.attribute=value


so this:

Quellcode

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


will become to:

Quellcode

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:

Quellcode

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:

Quellcode

1
preview.url=preview.jpg



and in swfobject 2.1 syntax:

Quellcode

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

Montag, 5. Oktober 2009, 21:07

Thank you, that's great.

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