# Using Senocular's Menu to Drive dynamic XML text

**URL:** <https://forum.kirupa.com/t/using-senoculars-menu-to-drive-dynamic-xml-text/77503>\
**Category:** flash\
**Created:** [January 27, 2005, 5:10pm UTC](https://forum.kirupa.com/t/using-senoculars-menu-to-drive-dynamic-xml-text/77503 "2005-01-27T17:10:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![webctbill](https://avatars.discourse-cdn.com/v4/letter/w/46a35a/32.png) [@webctbill](https://forum.kirupa.com/u/webctbill)\
**Post date:** [January 27, 2005, 5:10pm UTC](https://forum.kirupa.com/t/using-senoculars-menu-to-drive-dynamic-xml-text/77503/1 "2005-01-27T17:10:21Z")

</div>

I am trying to create a listing that is driven from the [**[color=#800080]XML-Driven Drop-Down Menu[/color]**](http://www.kirupa.com/developer/actionscript/xml_dropdown_menu.htm) that senocular made. (That is tight) I don’t have much exp using AS or xml but I am familiar with programming and love using flash.

My xml looks like this: in multiples

\<SEC.TERM\>3.00\</SEC.TERM\>  
\<SEC.LOCATION\>NOR\</SEC.LOCATION\>  
\<SEC.START.DATE\>01/08/05\</SEC.START.DATE\>  
\<SEC.END.DATE\>02/12/05\</SEC.END.DATE\>  
\<SEC.INSTR.METHODS\>HY\</SEC.INSTR.METHODS\>  
\<R17.XWEB.SEC.BLDG\>LIBR\</R17.XWEB.SEC.BLDG\>  
\<R17.XWEB.SEC.BLDG.ROOM\>115\</R17.XWEB.SEC.BLDG.ROOM\>  
\<R17.XWEB.LECTURE.DAYS\>S\</R17.XWEB.LECTURE.DAYS\>  
\<R17.XWEB.MEETING.DAYS\>S\</R17.XWEB.MEETING.DAYS\>  
\<SEC.START.DAY\>S\</SEC.START.DAY\>  
\<SEC.START.TIME\>08:30AM\</SEC.START.TIME\>  
\<SEC.END.TIME\>01:00PM\</SEC.END.TIME\>

And I want it layed out like:

3.00 NOR 01/08/05 02/12/05 HY LIBR 115 etc.  
3.00 NOR 01/08/05 02/12/05 HY LIBR 115 etc.  
3.00 NOR 01/08/05 02/12/05 HY LIBR 115 etc.

I like the way the menu does this with its list.

I think Senocular uses this:

// for all items or XML nodes (items and menus)  
// within this node\_xml passed for this menu  
for (var i=0; i\<node\_xml.childNodes.length; i++) {  
// movieclip for each menu item  
curr\_item = curr\_menu.attachMovie(“menuitem”,“item”+i+"\_mc", i);  
curr\_item.\_x = x;  
curr\_item.\_y = y + i\*curr\_item.\_height;  
curr\_item.trackAsMenu = true;

(I need to work on this type of variable passing. Is there a tutorial out there on this?)

My idea is to populate the above text into the required space using the same technique as in the menu. Creating a rollover effect that takes the info from an xml file.

My first idea was to use the action “message” to populate the required space, but I ran into a problem. The required text is dynamic and does not cover the same are, and will vary with the menu choice.

I used this to pull the xml:

function loadXML(loaded) {  
if (loaded) {  
\_root.header01 = this.firstChild.childNodes[0].childNodes[3].firstChild.nodeValue;  
\_root.desc01 = this.firstChild.childNodes[0].childNodes[6].firstChild.nodeValue;  
\_root.starts = this.firstChild.childNodes[0].childNodes[16].firstChild.nodeValue;  
\_root.ends = this.firstChild.childNodes[0].childNodes[17].firstChild.nodeValue;  
\_root.name01 = this.firstChild.childNodes[0].childNodes[4].firstChild.nodeValue;  
\_root.sub01 = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;  
\_root.crsno01 = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;  
\_root.units01 = this.firstChild.childNodes[0].childNodes[7].firstChild.nodeValue;  
\_root.code01 = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;  
\_root.hourss = this.firstChild.childNodes[0].childNodes[17].firstChild.nodeValue;  
\_root.hourse = this.firstChild.childNodes[0].childNodes[18].firstChild.nodeValue;  
\_root.days = this.firstChild.childNodes[0].childNodes[15].firstChild.nodeValue;  
\_root.room = this.firstChild.childNodes[0].childNodes[13].firstChild.nodeValue;  
\_root.build = this.firstChild.childNodes[0].childNodes[12].firstChild.nodeValue;  
title\_txt.text = \_root.header01;  
desc\_txt.text = \_root.desc01;  
code\_txt.text = \_root.code01;  
name\_txt.text = \_root.name01;  
etime\_txt.text = \_root.hourss;  
stime\_txt.text = \_root.hourse;  
subj\_txt.text = \_root.sub01;  
crsno\_txt.text = \_root.crsno01;  
units\_txt.text = \_root.units01;  
days\_txt.text = \_root.days;  
room\_txt.text = \_root.room;  
bldg\_txt.text = \_root.build;  
} else {  
content = “file not loaded!”;  
}  
}  
Looks very clunky. I think it can be written better.

Is it a combination of both? Any help is greatly appreciated.

Regards,

Bill
