Loading an array by variable name

  • I have built all my panorama tours into XML files that contain an array specifying the names of all the panos in the sequential tour, and so people can click previous and next in any tour to move from pano to pano. When I load any pano I can set a tourname variable which is then in an <include> tag and the array is included when the main xml of the pano is loaded, so it knows what tour it is part of. (A pano can be part of many different tours.)

    This works when invoking a tour from HTML which can pass variables.

    However, once inside the viewer, what's the best way to start a new tour, typically by wanting to load the first pano in the tour and make sure the tour array is loaded with it. The documentation says loadpano can pass variables, but they are not set until after the xml is parsed, so I presume that you can't provide a variable that goes in an <include>.

    I presume I can loadpano with MERGE on to load in just the array, but then will control come back to my code to then switch to the first pano with KEEP on to keep the tour array around? I presumed loadpano does not return to the action.

    I can also figure out the start of the tour elsewhere and invoke that pano with loadpano, but I need to pass it a tourname that is set for the include.

    Any advice on the best way to make this work? Summarizing:

    1. When I load a pano from HTML, I want to pass it what tour it is part of
    2. I also want to load panos from inside the player, telling them what tour they are part of for this run
    3. I want to be able to also effectively load a tour from HTML or the player, which means load the first pano in the tour and be ready to sequence through that tour.


    The tour file right now just has the array, though I could toss in actions for it to run if it is loaded directly, I guess.

  • A solution which seems to work is indeed to load the new xml with loadpano and MERGE, but remember to zero out the array you are loading or the entries in the new XML will be be appended to it. You can delete an array by setting array.count to 0.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!