...

View Full Version : calling an xml file in html



j05hr
12-14-2008, 11:24 AM
I bought a flash xml photo gallery, the problem is, it automatically loads gallery.xml, i want to make others so i can have more then one on my site.
I've spoken to the owner of the file but he's been less then helpful.

This is the code i've got from him and it just doesn't work it still points to gallery.xml

Here's what i got, how would i go about making it load a file called travel.xml?



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<div id="flexiGalleryContainer">
<script type="text/javascript">
var so = new SWFObject (swf, id, width, height, version, background-color);
so.addParam("BASE", "");
so.addVariable("settingsXML", "data/settings.xml");
so.addVariable ("galleryXML", "data/travel.XML");
so.write("flexiGalleryContainer");
</script>



<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
width="560"
height="540"
id="1"
align="middle">
<param name="allowScriptAccess" value="sameDomain" />

<param name="movie" value="travel.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#E6EAF2" />
<param name="base" value="./" />
<embed
src="gallery.swf"
quality="high"
bgcolor="#E6EAF2"
width="560"
height="540"
name="flash"
align="middle"
allowscriptaccess="sameDomain"
type="application/x-shockwave-flash"
base="./"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</div>

</body>
</html>


Thanks for the help

gnomeontherun
12-14-2008, 01:13 PM
Can you show us some Actionscript? That is where the magic actually happens.

j05hr
12-14-2008, 01:58 PM
There is no actionscript, you only get the .xml .swf and .js

It comes with a tutorial that i can paste if that will help?

But when i follow what it says it still points to gallery.xml




FlexiGallery: Embedding into HTML Page

For handy embedding of the FlexiGallery into HTML page we use SWFObject script
You may find required swfobject.js in the folder “FlexiGallery/js” of the distributive
In order to use it you have to include swfobject.js into your page <head>
Example:
<head>
<script type="text/javascript" src="http://mysite.com/FlexiGallery/js/swfobject.js"></script>
………….

Then you need to add a small amount of code into your page <body>:
1) Create a container for FlexiGallery
<div id="flexiGalleryContainer">
This text is replaced by FlexiGallery.
</div>
2) Create FexiGallery flash movie and add it to the <div> container
<script type="text/javascript">
var so = new SWFObject (swf, id, width, height, version, background-color);
so.addParam("BASE", "pathToFlexiGalleryFolder");
so.addVariable("settingsXML", "pathToSettingsXML");
so.addVariable ("galleryXML", "pathToGalleryXML");
so.write("flexiGalleryContainer");
</script>
swf - The file path and name to gallery.swf file on your web site
id - The ID of your object or embed tag
width - The width of your gallery
height - The height of your gallery.
version - The required player version for your Flash content. Have to be "8"
background-color - This is the hex value of the background color of your Flash movie.

BASE: path to the FlexiGallery folder on your website. This parameter is mandatory.
settingsXML [optional]: path to the settings.xml on your website.
By default it uses path: BASE + "data/settings.xml"
galleryXML [optional]: path to the gallery.xml on your website.
By default it uses path: BASE + "data/ gallery.xml"

Example:
</script>
var so=new SWFObject("http://mysite.com/FlexiGallery/gallery.swf","gallery","500","400","8","FFFFFF")
so.addParam("BASE", " http://mysite.com/FlexiGallery/");
so.addVariable("settingsXML", "data/settings.xml");
so.addVariable ("galleryXML", "data/gallery.xml");
so.write("flexiGalleryContainer");
</script>

Hint:
so.write("flexiGalleryContainer ") is adding FlexiGallery to the div with id="flexiGalleryContainer"

gnomeontherun
12-14-2008, 03:08 PM
Can you provide a link to the website or to a working swf? I really have no ideas besides changing those variables.
Are you sure the link was correct? You have uppercase letters in the link from the first post, make sure that is 100% the same.

j05hr
12-14-2008, 04:54 PM
sorry where's the capitals?

A working link is http://www.jasongold.org/testnew

gnomeontherun
12-14-2008, 09:02 PM
Capital Letters here


<script type="text/javascript">
var so = new SWFObject (swf, id, width, height, version, background-color);
so.addParam("BASE", "");
so.addVariable("settingsXML", "data/settings.xml");
so.addVariable ("galleryXML", "data/travel.XML");
so.write("flexiGalleryContainer");
</script>


Your site has travel.xml not travel.XML.

j05hr
12-14-2008, 10:42 PM
i changed it locally and it stilled didn't work, any other suggestions?

If not could i send you the zipped file somehow so you can have a go with it yourself?

gnomeontherun
12-15-2008, 10:53 AM
Sure I'll take a look. Just tell me how!

gnomeontherun
12-15-2008, 03:23 PM
This code works for me, assuming there is a travel.xml document in the subfolder data.

<script type="text/javascript">
var flash = new SWFObject("gallery.swf", "flash", "560", "540", "8.0.0", "#E6EAF2", true)
flash.addParam("wmode", "window");
flash.addParam("base", "./");
flash.addParam("align", "middle");
flash.addParam("scale", "noscale");
flash.addVariable ("galleryXML", "data/travel.xml");
flash.write("flash")
</script>

j05hr
12-15-2008, 06:29 PM
it seems to be working now, thank you so much!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum