carmenMiranda
Programmer
Hi, can anyone help me with the following problem:
An SWF is embedded in an HTML page. The SWF links to an external URL via a button. The external URL is defined in an XML file, so that it can be easily updated on a regular basis.
However, if the SWF and the XML file are not placed in the same directory as the HTML page, the call to the URL doesn't work.
Code to load the XML:
var destinationURL:String;
var externalData:XML = new XML();
externalData.ignoreWhite = true;
externalData.onLoad = parse;
externalData.load("targetURL.xml");
function parse(success) {
if (success) {
destinationURL = String(this.firstChild.attributes.address);
if (destinationURL == "") {
destinationURL = " }
} else {
trace("XML document not loaded");
}
}
Code for the button:
this.clickBtn.onRelease = function() {
getURL(destinationURL, "_self");
}
Code in the XML file:
<destinationURL address="
I would really like to be able to place the SWF and the XML file together in their own directory, discreet from the HTML page into which the SWF is loaded.
Can anyone help me by explaining how I can achieve this?
Many thanks in advance.
An SWF is embedded in an HTML page. The SWF links to an external URL via a button. The external URL is defined in an XML file, so that it can be easily updated on a regular basis.
However, if the SWF and the XML file are not placed in the same directory as the HTML page, the call to the URL doesn't work.
Code to load the XML:
var destinationURL:String;
var externalData:XML = new XML();
externalData.ignoreWhite = true;
externalData.onLoad = parse;
externalData.load("targetURL.xml");
function parse(success) {
if (success) {
destinationURL = String(this.firstChild.attributes.address);
if (destinationURL == "") {
destinationURL = " }
} else {
trace("XML document not loaded");
}
}
Code for the button:
this.clickBtn.onRelease = function() {
getURL(destinationURL, "_self");
}
Code in the XML file:
<destinationURL address="
I would really like to be able to place the SWF and the XML file together in their own directory, discreet from the HTML page into which the SWF is loaded.
Can anyone help me by explaining how I can achieve this?
Many thanks in advance.