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?

    Code
    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?

  • Hi,

    yes, that's possible,

    Code
    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:

    Code
    <note1>
      <node2 attribute="value" />
    </node>


    will become to:

    Code
    node1.node2.attribute=value

    so this:

    Code
    <krpano>
      <preview type="SPHERE" url="preview.jpg" />
    </krpano>

    will become to:

    Code
    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:

    Code
    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:

    Code
    preview.url=preview.jpg


    and in swfobject 2.1 syntax:

    Code
    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

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!