blu3_eyez
01-29-2008, 10:21 PM
I am trying to create an XML list with links, but instead of clicking on the link, i am wanting to click on a button with action scripting tied to it. I will copy and pasted below what I have so far. Im not sure if this is possible or not though, so any help is appreciated.
Action script so far.
// Create new XML Object and set ignoreWhite true
hypro_xml = new XML();
hypro_xml.ignoreWhite = true;
// Setup load handler which just invokes another function
// which will do the parsing of our XML
hypro_xml.onLoad = function(sucess) {
if (sucess) {
processNews(hypro_xml);
}
};
// Load up the XML file into Flash
hypro_xml.load('news.xml');
// This is the function that will be called when
// our XML document is loaded succesfully
function processNews(hypro_xml)
{
hypro_xml.ignoreWhite = true;
var d = hypro_xml.firstChild.childNodes;
var l = d.length;
output = "";
for(var c = 0; c < l; c++) {
output += "<p><a href=\"" + d[c].attributes.url + "\" target=\"_blank\">" + d[c].firstChild.nodeValue + "</a></p>";
}
// Displays XML
_root.news.content = output;
}
And the Action script for the button.
on (rollOver)
{
this.gotoAndPlay("s1");
}
on (releaseOutside, rollOut)
{
this.gotoAndPlay("s2");
}
Thanks
Action script so far.
// Create new XML Object and set ignoreWhite true
hypro_xml = new XML();
hypro_xml.ignoreWhite = true;
// Setup load handler which just invokes another function
// which will do the parsing of our XML
hypro_xml.onLoad = function(sucess) {
if (sucess) {
processNews(hypro_xml);
}
};
// Load up the XML file into Flash
hypro_xml.load('news.xml');
// This is the function that will be called when
// our XML document is loaded succesfully
function processNews(hypro_xml)
{
hypro_xml.ignoreWhite = true;
var d = hypro_xml.firstChild.childNodes;
var l = d.length;
output = "";
for(var c = 0; c < l; c++) {
output += "<p><a href=\"" + d[c].attributes.url + "\" target=\"_blank\">" + d[c].firstChild.nodeValue + "</a></p>";
}
// Displays XML
_root.news.content = output;
}
And the Action script for the button.
on (rollOver)
{
this.gotoAndPlay("s1");
}
on (releaseOutside, rollOut)
{
this.gotoAndPlay("s2");
}
Thanks