PDA

View Full Version : passing variable


adirider30
11-18-2007, 05:16 PM
Hello all, I am new to this forum!
I have purchased the software - its really great. Its so flexible!

I have setup a new website with about 50 panoramas.
To make the administration more simple I manage the general panorama-configuration by only one xml-file. (logobutton, quality, plugins...)

Individual parameters like panoName, tiltHome and panHome I pass through the querystring and add them to the javascript by using PHP. That works great.

<script type="text/javascript">
var so = new SWFObject("files/show_pano.swf", "pano", "100%", "420", "9", "#ffffff");
so.addVariable("movie","files/pano.swf?xml_file=files/config.xml");
so.addVariable("redirect", window.location);
so.addVariable("panoName", "<?php echo $image; ?>");
so.addVariable("panHome", <?php echo $pan; ?>);
so.addVariable("tiltHome", <?php echo $tilt; ?>);
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.write("flashcontent");
</script>

Now I was trying to pass parameters for individual hotspots or plugins.
I tried xml_text but this fails, because it makes the main xml file worthless, being completely ignored.

Is there a method for passing parameters to hotspots via javascript?
something like the following:

so.adVariable ("panorama.hotspots.global.myspot.tilt","100");
so.adVariable ("panorama.hotspots.global.lens.tilt","120");


I cannot use a single xml file for each pano, this makes it very uncomfortable.
I would have to change 50 files every time I like to change my configuration.

Please help!

Thanx and Regards
ADi

zleifr
11-19-2007, 03:13 AM
you might look into externalInterface (check the hotspots documentation). It allow javascript to flash communication. you will have to change just how you do it though, as you can only start executing commands that originate in the javascript AFTER the everything is loaded and going (you are talking about setting it up at load time. however, I am quite certain that you can make externalInterface work for you somehow.

Since you are obviously at least somewhat comfortable in php, you might look into having php output your xml based on the template. that way, you load the php with xml_file=xmlGenerator.php?param=value&param=value. That way you can pass the hotspot variable in the query string to php which processes them and outputs the xml to FPP all at load time.

hope that helps