# XML callback function(iteration of Squirrel Finder)

**URL:** <https://forum.kirupa.com/t/xml-callback-function-iteration-of-squirrel-finder/238568>\
**Category:** flash\
**Created:** [September 12, 2007, 6:04pm UTC](https://forum.kirupa.com/t/xml-callback-function-iteration-of-squirrel-finder/238568 "2007-09-12T18:04:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RWhite](https://avatars.discourse-cdn.com/v4/letter/r/3e96dc/32.png) [@RWhite](https://forum.kirupa.com/u/RWhite)\
**Post date:** [September 12, 2007, 6:04pm UTC](https://forum.kirupa.com/t/xml-callback-function-iteration-of-squirrel-finder/238568/1 "2007-09-12T18:04:00Z")

</div>

Hello,

Went through the Squirrel Finder tut and got it working fine, thanks! Now attempting to use the new found tech in a CDROM project where menus are built after runtime (96 frames after) from an XML object.

Problem (I think) is the XML object is being created on Frame1 and I need the functionality of the menus on Frame 96.

Tried a callback function but no pay dirt. Here is the code snipet…

//starts script for menus, where menus\_xml is the XML object previously created.  
menus\_xml.load()

function DisplayInfo(){  
parent\_mc.\_visible = false; //is the movie clip instance name  
sub\_mc.\_visible = true; //is the movie clip instance name  
sub\_mc.sub\_menu\_txt.text = this.description\_text;  
}…

Then later, the function CreateMenu is called (same as the Squirrel)

//CreateMenu function  
function CreateMenu(menus\_xml){ //calles stored xml object “menus\_xml”  
// start with the first item in the XML  
var items = menus\_xml.firstChild.firstChild.childNodes;  
// menu -\> menu\_items -\> childNode:item  
for (var i=0; i\<items.length; i++) {…

When I run Debug, \_level0 shows the XML object menus\_xml and all the content is in there. No errors are output to the Output pane throughout the test movie process. The menu “visibility” seems to be working correctly too, though the firstChild menu is displaying but with no content, the sibling is not (correct behavior).

I guess the short question is how do I properly create a callback function for data (stored in the XML object \_level0:menus\_xml) later in the timeline.

Any thoughts are appreciate.

Thank you.  
rwhite
