Jump to content

Xml Swf Object Relative Path


tinfanide
 Share

Recommended Posts

Suppose I have a swf file, a xml file and a html file that contains the swf objects,they're in different locations The HTML file:C:\xampp\htdocs\english\

   <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="720" height="480" id="images/Latest/homepage_slideshow" align="middle">    <param name="movie" value="images/Latest/homepage_slideshow.swf" />    <param name="quality" value="high" />    <param name="bgcolor" value="#ffffff" />    <param name="play" value="true" />    <param name="loop" value="true" />    <param name="wmode" value="transparent" />    <param name="scale" value="showall" />    <param name="menu" value="true" />    <param name="devicefont" value="false" />    <param name="salign" value="" />    <param name="allowScriptAccess" value="sameDomain" />    <!--[if !IE]>-->    <object type="application/x-shockwave-flash" data="images/Latest/homepage_slideshow.swf" width="720" height="480">	 <param name="movie" value="images/Latest/homepage_slideshow.swf" />	 <param name="quality" value="high" />	 <param name="bgcolor" value="#ffffff" />	 <param name="play" value="true" />	 <param name="loop" value="true" />	 <param name="wmode" value="transparent" />	 <param name="scale" value="showall" />	 <param name="menu" value="true" />	 <param name="devicefont" value="false" />	 <param name="salign" value="" />	 <param name="allowScriptAccess" value="sameDomain" />    <!--<![endif]-->	 <a href="http://www.adobe.com/go/getflash">	  <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />	 </a>    <!--[if !IE]>-->    </object>    <!--<![endif]-->   </object>

images, xml, swf are inC:\xampp\htdocs\english\images\Latest a.jpgb.jpg For the xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><slideshow><image src="a.jpg" desc="a"/><image src="b.jpg" desc="b"/></slideshow>

For the swf (fla actionscript):

var strXMLPath:String = "/images/Latest/homepage_slideshow.xml";

I have no idea of how to make the relative paths right.If all the files (html, images, xml and swf) are placed under the same directory, no problem exists.But now they're put in different locations, it comes the problems then.

Link to comment
Share on other sites

  • 2 weeks later...

If the path starts with a slash, then it is relative to the root of the domain. If it doesn't start with a slash then it is relative to the current directory. Paths in Flash should be relative to the SWF file, not the HTML file that includes it. You can use a tool like Firebug to look at the Net tab and find things that return a 404 and check the path to see where it's actually looking.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...