Vars parameter parsing error

  • Hi,

    I am trying to override or set some variables just before embedding the viewer, using the vars parameter of the parametersobject passed to embedpano(). This is for an embedded .swf created using the "singleswf" template (in linux with kmakemultires -config=templates/singleswf.config).

    I would like to set the autorotate on, and adjust the zoom level. So, I am creating the vars parameter as an object containing the settings to match the xml settings. However I am getting "ERROR: parsing parameters failed - TypeError: Error #1034" thrown in the Flash overlay.

    Am I using the settings in the right way? Is it possible to set these in the js object, or do I need to do this in the xml?

    Here is my code:

    Code
    vt = {  parameters: {    swf: '',    target: 'krpano',    xml: '',    width: '940px',    height: '637px',    vars: { autorotate: { enabled: true} },  },  go: function() {    // Parameters    vt.parameters.swf = Drupal.settings.virtual_tour.swf;    vt.parameters.xml = Drupal.settings.virtual_tour.xml;    // Embed    embedpano(vt.parameters);  }}if (typeof window.jQuery != "undefined") {  jQuery(vt.go);}


    Any pointers?

    Thanks, David

    PS. Sorry - my code keeps getting collapsed inside the code tags

  • Hi,

    the krpano variable names need to stored as Strings, passing Objects will not work,

    e.g. to set the "autorotate.enabled" variable it would be necessary to set it this way:

    Code
    var vars = {};
    vars["autorotate.enabled"] = true;
    embedpano({...., vars:vars, ...});

    best regards,
    Klaus

Participate now!

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