# (MX04) Squirrel finder - adding another button

**URL:** https://forum.kirupa.com/t/mx04-squirrel-finder-adding-another-button/195015
**Category:** flash
**Created:** [July 27, 2006, 8:22pm UTC](https://forum.kirupa.com/t/mx04-squirrel-finder-adding-another-button/195015 "2006-07-27T20:22:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Mizztah\_H](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Mizztah\_H](https://forum.kirupa.com/u/Mizztah_H)
#### Post date: [July 27, 2006, 8:22pm UTC](https://forum.kirupa.com/t/mx04-squirrel-finder-adding-another-button/195015/1 "2006-07-27T20:22:30Z")

</div>

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
