I know alot of people have had the problem of linking there xml file from an outside source. My problem is that I want to us xml to dynamically set up links to foreign addresses(as in not local;i.e bob.com/bob.jgp and bob.com/bob2.jgp)like www.yahoo.com ect.
my flash code is simple, it loads the xml file, reads the location of the url with in the xml file. there is no real error persay in the code but more of a problem with the flash security.
this is my xmlPHP Code:var my_xml = new XML();
my_xml.load("cvb.xml");
my_xml.ignoreWhite = true;
var loaded_status:Boolean = false;
var percent:Number = 0;
var url:String;
function onEnterFrame() {
loadbar._xscale = percent;
load_xml();
if (percent == 100) {
button_xml_hyperlink(_button1);
//trace(my_xml.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue);//town name
//trace(my_xml.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue);//description
//trace(my_xml.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue);//url
}
}
function load_xml() {
if (loaded_status == false) {
myxml_total = my_xml.getBytesTotal();
myxml_loaded = my_xml.getBytesLoaded();
percent = (myxml_loaded/myxml_total)*100;
if (percent == 100) {
url = my_xml.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;
loaded_status = true;
delete this;
}
}
}
function button_xml_hyperlink(_button_name) {
_button_name.onRelease = function() {
loadMovie(url, hero2);
getURL(url, "_blank");
};
}
in a nutshell i want to know what i need to do to get this working. thank you in advancedPHP Code:<?xml version="1.0" encoding="ISO-8859-1"?>
<state>
<town>
<townname>Huntington</townname>
<description>Huntington, is cool!</description>
<url><![CDATA[http://www.yahoo.com/index.html]]></url>
</town>
<town>
<townname>Bob Land</townname>
<description>Bob Land, has the largest people in the world.</description>
<url>http://www.google.com</url>
</town>
</state>


Reply With Quote