PDA

View Full Version : path issues


scheving
04-16-2009, 04:02 PM
I have been searching the forum here, and seen a few posts about this problem, however I haven't been able to figure this out... I know, shame on me! ;)

This is a problem with paths..

My structure:
My html page is here: mysite.com/places/place1.html
and has this code:
<script type="text/javascript" src="../files/swfobject.js"></script>
<div id="flashcontent">This content requires <a href="http://www.adobe.com/go/getflashplayer/">Adobe Flash Player</a> and a browser with JavaScript enabled.<br />
Built on <a href="http://flashpanoramas.com/player/">Flash Panorama Player</a>.</div>
<script type="text/javascript">
var so = new SWFObject("files/show_pano.swf", "pano", "960", "500", "6.0.65", "#282828");
so.addVariable("movie", "files/pano.swf");
so.addVariable("xml_file", "xml/jokulsargljufur.xml")
so.addVariable("redirect", window.location);
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.write("flashcontent");
</script>

But the xml file and the swf files don't load, I assume that is because of some path issues.

I hope you guys understand what I mean, difficult to get this into words ;)

Nate
04-16-2009, 06:03 PM
so, it looks like pano.swf loads into mysite.com/places/place1.html. Right? So then pano.swf looks for the files relative to the document that it is in. So according to your code, it is looking for mysite.com/places/files/pano.swf and mysite.com/places/xml/jokulsargljufur.xml.
If you can see what the page is looking for (activity window on a mac) then you can actually see where the files should be and adjust your code accordingly. Here's my guess:
<script type="text/javascript">
var so = new SWFObject("../files/show_pano.swf", "pano", "960", "500", "6.0.65", "#282828");
so.addVariable("movie", "../files/pano.swf");
so.addVariable("xml_file", "../xml/jokulsargljufur.xml")
so.addVariable("redirect", window.location);
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.write("flashcontent");
</script>

Good Luck!

scheving
04-16-2009, 07:00 PM
Didn't know about this activity window on a mac!!! BIG HELP ;)

Well I ended up with this:
<script type="text/javascript" src="../files/swfobject.js"></script>
<div id="flashcontent">This content requires <a href="http://www.adobe.com/go/getflashplayer/">Adobe Flash Player</a> and a browser with JavaScript enabled.<br />
Built on <a href="http://flashpanoramas.com/player/">Flash Panorama Player</a>.</div>
<script type="text/javascript">
var so = new SWFObject("/files/show_pano.swf", "pano", "960", "500", "6.0.65", "#282828");
so.addVariable("movie", "/files/pano.swf");
so.addVariable("xml_file", "../xml/jokulsargljufur.xml")
so.addVariable("redirect", window.location);
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.write("flashcontent");
</script>

and in my XML
layer_10 = ../files/glassMeter.swf
layer_1 = ../files/fps.swf
layer_3 = ../files/limits.swf
layer_6 = ../files/cylConverter.swf
layer_7 = ../files/movDecoder.swf
layer_8 = ../files/menuFullscreen.swf
layer_2 = ../files/hotspots.swf
layer_5 = ../files/autorotator.swf

worked really good ;) thanks for the help