PDA

View Full Version : passing hotspots using swfObject code?


natanshar
05-28-2008, 02:02 PM
Hi guys.

I cannot figure out the syntax of passing the navigation hostspots using the swfObject. It works fine using the xml file. And I am fine using the xml file for 99% of the configuration. BUT, I need to be able to use php to echo the panoName on the fly.

The documentation implied that I could use both embedded xml via the swfObject and an external XML file, and that would serve my purpose perfectly. That way the only parameter named in the swfObject code would be the panoName, while everything else (including navigation hotspots) would be in the XML file that applies to all the tours.

If that is not possible, can someone help me out with the coding for the swfObject so.addVariable line that includes hostpots? I cannot get it to work, and I am sure it is just a matter of my inferior skills.

Thanks so much!
Natan Shar

cheathamlane
05-28-2008, 02:25 PM
Hi Natan:

View source at this page, and look for the swfObject block:
http://www.cheathamlane.net/

You can pass the panoName right in an addVariable line. Using PHP it should be a snap to echo the panoName into place.

As for passing hotspots via the swfObject -- I have had intermittent luck with using FPP's "xml_text". It tends to be buggy and/or overwrite any 'actual' XML file I have.

?

natanshar
05-28-2008, 03:24 PM
Patrick,

I have followed your example, and still cannot get it to work.

Here is my swfObject code:

<script type="text/javascript">
var so = new SWFObject("files/pano.swf", "pano", "700", "400", "9", "#282828");
so.addVariable("movie","files/pano.swf?panoName=images/stlouis&xml_file=stlouis.xml");
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.write("flashcontent");
</script>

My xml_file has the hotspots in it, and it is showing up correctly. But the pano itself is still not loading. It is a cubical pano and the images are named correctly. If I replace the initial line with this:

var so = new SWFObject("files/pano.swf?panoName=images/stlouis", "pano", "700", "400", "9", "#282828");

the object loads fine, but none of the info from the xml file is loaded - autorotate, hotspots, motionquality, limits, etc.

It appears that I can EITHER name the pano OR load an xml file, but not both. This is why I was going to try and load the entire xml file as a var.so. I would much rather do it more cleanly, as you have.

Any ideas?

this is at http://www.NextStep360.com/stlouis

natanshar
05-28-2008, 03:46 PM
Here is what finally got it working:

var so = new SWFObject("files/pano.swf?panoName=images/stlouis&xml_file=stlouis.xml", "pano", "700", "400", "9", "#282828");

finally.

http://www.NextStep360.com/stlouis/index1.html

Now my only frustration is that the autorotation is not auto-rotating at the start. I will figure that out.

Thanks,