(MX04) Squirrel finder - adding another button

Hi again

I have been following the “Intro to XML” 'tute and decided to try and modify the “[COLOR=blue]Squirrel Finder[/COLOR]” project in an attempt to get to grips with it all.

What I have attempted to do is add an additional button to the “[COLOR=blue]Infobox_mc[/COLOR]” called “[COLOR=blue]closeall_btn[/COLOR]” which closes all visible mcs and loads another swf into an empty mc called “[COLOR=blue]loadbox_mc[/COLOR]”.

The xml document has an additional element placed after the [COLOR=blue]“location[/COLOR]” element called “[COLOR=blue]buttonname[/COLOR]” containing the name of each swf -eg [COLOR=blue]albert_squirrel.swf[/COLOR].

I have added the following AS:

// create variables for our elements
[COLOR=blue]var [/COLOR]species = [COLOR=blue]items[/COLOR][COLOR=blue].[/COLOR][COLOR=blue]firstChild[/COLOR]; // same as items.childNodes[0]*

  • [COLOR=blue]var location[/COLOR] = [COLOR=blue]items[/COLOR][COLOR=blue].[/COLOR][COLOR=blue]childNodes[/COLOR][1]; // second child node
  • [COLOR=blue]var [COLOR=black]swflist =[/COLOR] items[COLOR=black].*[/COLOR]childNodes[COLOR=black][2];[/COLOR] [COLOR=black]// added line creating variable[/COLOR][/COLOR]

What I wish to do now is assign the relevent value from variable [COLOR=blue]swflist [/COLOR]to the following function

infobox_mc.closeall_btn.[COLOR=blue]onRelease[/COLOR] = [COLOR=blue]function/COLOR{
menu_mc.[COLOR=blue]_[/COLOR][COLOR=blue]visible[/COLOR] = [COLOR=blue]false[/COLOR];
infobox_mc[COLOR=blue].visible[/COLOR] = [COLOR=blue]false[/COLOR];
loadbox_mc.
[COLOR=blue]visible[/COLOR] = [COLOR=blue]true[/COLOR];
start_infobox_mc[COLOR=blue]._visible[/COLOR] = [COLOR=blue]false[/COLOR];
infobox_mc.content_txt.[COLOR=blue]text[/COLOR] = [COLOR=blue]""[/COLOR];
//attempt to pass the value from the xml to play intarget [COLOR=black]loadbox.mc[/COLOR]
LoadMovie("[COLOR=blue]whatever the value is assigned from variable sfwlist[/COLOR]", [COLOR=blue]loadbox_mc[/COLOR]");
close_box[COLOR=blue]._visible[/COLOR] = [COLOR=blue]true[/COLOR];

}

As you can guess I’m a newbie so can someone stop my suffering and point me in the right direction, I’ve had a few attempt but have got me nowhere.

thanks

Lee