[RESOLVED] xml links loaded into a button within a MC
Hi, im currently settig up a simple (well i thought it would be simple) navigation panel that has a button within a MC, im loading the links for the buttons from XML and they load into buttons that are on the main timeline no problem. But when i try and load those links to the same buttons that are nexsted within a MC they dont work. Any ideas? Heres the code im using to just get buttons on the main time line working
_xml = new XML();
_xml.ignoreWhite = true;
_xml.load("balloonxml.xml");
-------------------------------------------------
Heres the XML
---------------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<links>
<link>http://www.google.com</link>
where your movieclip has the instance name on stage of - mc1
mc1.myButton1.onRelease = function(){
// your xml file as posted has only one node
// so you need to access - linksArray[0]
trace(linksArray[0].childNodes);
getURL(linksArray[0].childNodes, "_self");
};
Hi Dog, many thanks for replying. I did try that but with no success ie.
panel1_mc.myButton1.onRelease = function(){
trace(linksArray[1].childNodes);
getURL(linksArray[1].childNodes, "_self");
};
great that works, thankyou. Re my note that within my movie clip (eg. mc1) the button appears at frame 18, because i have the button dropping down from beind a panel, so would that still work using the code you supplied or would i need to do something else?
Hi Dog, ive managed to get all that working but only by stripping out some other parts of this movie, all the parts which i need in there to make my buttons work. If you have time could you possibly take a look at the attached file to see if you could shed some light on how i can achieve what i need ie. all the buttons in the balloon movieclips having their links loaded from the xml.
I would gladly pay for your time, if you send over your Paypal details!!
i cannot open Flash version 9 fla files
please use Save As .. Flash 8 file
attached is a Flash 8 file.
a variable is declared and attached to the movieclip within the onLoad function
the code for myButton1 is now placed on frame#8 of the movieclip.
Note: code on frame#1(main timeline) cannot scope to frame#8 (movieclip)
Hi Dog, that is great!!, ive tested it in flash and works great, ie. i see the links coming through on the Output viewer. Ive loaded the files in to my pages click on the links and nothing happens, thought it might be linkage issue with the XML doc but checked and rechecked and all looks correct, any ideas??