Sie sind nicht angemeldet.

1

Donnerstag, 24. Mai 2012, 02:29

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:

Quellcode

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

Freitag, 25. Mai 2012, 08:04

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:

Quellcode

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


best regards,
Klaus

3

Samstag, 26. Mai 2012, 23:54

Thanks

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

David

Ähnliche Themen