Okay I am working on a personal project and I need to know if XML will be able to display an ‘swf’ file threw ActionScript.
<?xml version="1.0" encoding="iso-8859-1"?>
<myNews>
<newsItem>
<news date="versus media group, llc" />
<content>Versus Media Group is a company that I co-own with my business partner Joseph Hawk. We specialize in digital marketing and advertising.</content>
<swf>versusmediagroup.swf</swf>
<link>http://www.versusmediagroup.com</link>
</newsItem>
</myNews>
This is my XML file, cut down for one entry, and so far I have the first two displaying correctly, it runs threw the xml file parses the ‘date’ attribute and displays it vertically and the ‘content’ is displayed in a dynamic text box.
Here is my action script thus far:
stop();
//
path = this;
function loadXML(success) {
if (success) {
xmlNode = this.firstChild.childNodes;
for (i=0; i<xmlNode.length; i++) {
var date = xmlNode*.childNodes[0].attributes.date;
var desc = xmlNode*.childNodes[1].firstChild.nodeValue;
var swf = xmlNode*.childNodes[2].firstChild.nodeValue;
var link = xmlNode*.childNodes[3].firstChild.nodeValue;
var cmc = path.attachMovie("newsItem", "newsItem"+i, path.getNextHighestDepth());
cmc._y = i*cmc._height;
cmc.news_txt.text = date;
cmc.desc = desc;
cmc.swf = swf;
cmc.link_txt.text = link;
cmc.news_btn.onRelease = function() {
desc_txt.text = this._parent.desc;
swf_container = this.loadMovie(swf);
link_mc = this._parent.link;
};
}
}
}
var news_xml = new XML();
news_xml.ignoreWhite = true;
news_xml.onLoad = loadXML;
news_xml.load("web.xml");
Again the first two parts are working fine but i can’t get the link to the swf to open the swf file, and the link to use the launch button. also i’m not sure how to do this but i would like to be able to hide the launch button if a link isn’t available.
Here is a link to the work so far: