You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, May 24th 2012, 2:29am

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:

Source code

1
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

2

Friday, May 25th 2012, 8:04am

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:

Source code

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


best regards,
Klaus

3

Saturday, May 26th 2012, 11:54pm

Thanks

Thanks, Klaus - that works really well. I appreciate the quick response :)

David

Similar threads