I'm attempting to dynamically add the ability to load a specific scene by passing a variable through the URL. (E.G. http://domain.com/tour.php?scene=1) Everything seems to be working fine up until I try to have the xml file parse the variable; it returns "[object Object]" instead of the value I'm passing.
Here's the pertinent code:
PHP
Code
// Grab the variable from the URL. If not present, default to scene 0
if (isset($_GET['scene'])) {
$loadScene = $_GET['scene'];
} else {
$loadScene = "0";
}
to Javascript
PHP
// Create Viewer
var viewer = createPanoViewer({swf:"virtualtour.swf", xml:"virtualtour.xml", target:"panoDIV"});
viewer.addVariable("scene", '<?php echo $loadScene; ?>');
viewer.embed();
to virtualtour.xml
results in "FATAL ERROR: virtualtour[object Object].xml - loading failed! (404)" ... which makes sense because, well, that file doesn't exist.
Any ideas why the variable doesn't pass through correctly? Thanks!