# Help with flash/xml file please

**URL:** <https://forum.kirupa.com/t/help-with-flash-xml-file-please/248807>\
**Category:** flash\
**Created:** [January 11, 2008, 7:42pm UTC](https://forum.kirupa.com/t/help-with-flash-xml-file-please/248807 "2008-01-11T19:42:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kknutson](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@kknutson](https://forum.kirupa.com/u/kknutson)\
**Post date:** [January 11, 2008, 7:42pm UTC](https://forum.kirupa.com/t/help-with-flash-xml-file-please/248807/1 "2008-01-11T19:42:38Z")

</div>

![](http://forum.kirupa.com/uploads/kirupa/4231/f38553b231dde822.gif) ![](http://forum.kirupa.com/uploads/kirupa/1432/05166a9250c5a626.gif) ![](http://forum.kirupa.com/uploads/kirupa/4232/c36d7e6aae282570.gif) ![](http://forum.kirupa.com/uploads/kirupa/1432/05166a9250c5a626.gif)[Home[URL=“http://www.actionscript.org/resources/categories/Tutorials/”]Tutorials[URL=“http://www.actionscript.org/forums/index.php3”]Forums[URL=“http://www.actionscript.org/resources/categories/Articles/”]Articles[URL=“http://www.actionscript.org/resources/blogs”]Blogs[URL=“http://www.actionscript.org/movies-categories.php”]Movies[URL=“http://www.actionscript.org/actionscripts\_library/”]Library[URL=“http://www.actionscript.org/employment/register.php”]Employment[URL=“http://www.actionscript.org/resources/categories/Press-Releases/”]Press[URL=“http://www.actionscript.org/templates/flash\_intro\_templates.php”]Buy templates](http://www.actionscript.org/index.php)

[Advertise[URL=“http://www.actionscript.org/resources/pages/Contact-Us”]About us[URL=“http://www.actionscript.org/resources/sitemap.php”]Site map[URL=“http://www.actionscript.org/resources/pages/Syndicate”]Syndicate[URL=“http://www.actionscript.org/resources/search/advanced”]Search site[URL=“http://www.actionscript.org/cgi-bin/dada/mail.cgi/list/general/”]Mailing list[URL=“http://www.actionscript.org/resources/authors”]View Authors[URL=“http://www.actionscript.org/resources/authors/register”]Become an Author](http://www.actionscript.org/resources/pages/Advertising)  
 ![](http://forum.kirupa.com/uploads/kirupa/1432/05166a9250c5a626.gif)  
var so = new SWFObject("/img/as\_logo.swf", “logo”, “170”, “70”, “5”, “#FFFFFF”); so.write(“logo”); ![](http://www.actionscript.org/ads/adlog.php?bannerid=15&clientid=16&zoneid=3&source=&block=0&capping=0&cb=920a023a7e3f03f937805934fd39dd3b)

![](http://forum.kirupa.com/uploads/kirupa/1432/05166a9250c5a626.gif) ![](http://forum.kirupa.com/uploads/kirupa/1432/05166a9250c5a626.gif)

[LEFT][![](http://www.actionscript.org/forums/images/misc/navbits_start.gif) [URL=“http://www.actionscript.org/forums/index.php3”][COLOR=#333333]ActionScript.org Forums[/COLOR] \> [URL=“http://www.actionscript.org/forums/forumdisplay.php3?f=84”][COLOR=#333333]ActionScript Forums Group[/COLOR] \> [URL=“http://www.actionscript.org/forums/forumdisplay.php3?f=35”][COLOR=#333333]ActionScript 2.0[/COLOR] [URL=“http://www.actionscript.org/forums/showthread.php3?t=157551”] ![](http://forum.kirupa.com/uploads/kirupa/4234/765f021a5998d36e.gif) \*\*help with flash/xml menu please \*\*User NameRemember Me?Password [CENTER][URL=“http://www.actionscript.org/forums/register.php3”]Register[URL=“http://www.actionscript.org/forums/faq.php3”]FAQ[URL=“http://www.actionscript.org/forums/memberlist.php3”]Members List[URL=“http://www.actionscript.org/forums/calendar.php3”]Calendar[URL=“http://www.actionscript.org/forums/search.php3?do=getdaily”]Today’s Posts[URL=“http://www.actionscript.org/forums/search.php3”]Search](http://www.actionscript.org/forums/showthread.php3?t=157551#) [/CENTER]

[LEFT]Search Forums  
Show Threads Show Posts [[COLOR=#22229c]Advanced Search[/COLOR]](http://www.actionscript.org/forums/search.php3)  
Go to Page…  
[![](http://www.actionscript.org/forums/images/buttons/reply.gif)[URL=“http://www.actionscript.org/forums/showthread.php3?t=157551#post692125”] ![](http://www.actionscript.org/forums/images/buttons/firstnew.gif) [URL=“http://www.actionscript.org/forums/showthread.php3?t=157551#post692125”]**[COLOR=#ffffff]View First Unread[/COLOR]**](http://www.actionscript.org/forums/newreply.php3?do=newreply&noquote=1&p=692125)  
[Thread Tools vbmenu\_register(“threadtools”); ![](http://forum.kirupa.com/uploads/kirupa/4235/8d398f24c6116d9c.gif) [URL=“http://www.actionscript.org/forums/showthread.php3?t=157551&nojs=1#goto\_threadrating”]Rate Thread vbmenu\_register(“threadrating”); ![](http://forum.kirupa.com/uploads/kirupa/4235/8d398f24c6116d9c.gif) [URL=“http://www.actionscript.org/forums/showthread.php3?t=157551&nojs=1#goto\_displaymodes”]Display Modes](http://www.actionscript.org/forums/showthread.php3?t=157551&nojs=1#goto_threadtools) vbmenu\_register(“displaymodes”); ![](http://forum.kirupa.com/uploads/kirupa/4235/8d398f24c6116d9c.gif) [/LEFT]

[LEFT] ![](http://www.actionscript.org/forums/images/statusicon/post_new.gif) Today, 07:07 PM #[**1** [URL=“http://www.actionscript.org/forums/member.php3?u=63864”][COLOR=#333333]kknutson[/COLOR]](http://www.actionscript.org/forums/showpost.php3?p=692125&postcount=1) vbmenu\_register(“postmenu\_692125”, true);  
Registered User[/LEFT]

[LEFT]Join Date: Jan 2008  
Posts: 1 [/LEFT]

[LEFT] ![](http://www.actionscript.org/forums/images/icons/icon1.gif) **help with flash/xml menu please**  
Hello I am a beginner to intermidate flash user…still lots to learn in actionscript and just learning xml.[/LEFT]

[LEFT]I found a cool menu that I’d like to be able to use but right now I don’t know how to make the buttons become functional links.[/LEFT]

[LEFT]Can someone tell me if its just a matter of editing the XML only? Or…does something need to be added to the actionscipt as well. I have a hunch both need to be edited and I have already tried various revisions.[/LEFT]

[LEFT]If possible please let me know what code I need to use to make it work.[/LEFT]

[LEFT]Below is the link where the example and files can be found.[/LEFT]

[LEFT][[COLOR=#333333]http://www.ffiles.com/flash/menus/4\_xml\_menus\_1118.html[/COLOR]](http://www.ffiles.com/flash/menus/4_xml_menus_1118.html)[/LEFT]

[LEFT]Here is the XML code[/LEFT]

[LEFT]\<?xml version=“1.0” encoding=“iso-8859-1”?\>[/LEFT]

[LEFT]\<item nazov=“button num 1 “load=”” image=""/\>[/LEFT]

[LEFT]\<item nazov=“button num 2” load="" image=""/\>[/LEFT]

[LEFT]\<item nazov=“button num 3” load="" image=""/\>[/LEFT]

[LEFT]\<item nazov=“button num 4” load="" image=""/\>[/LEFT]

[LEFT]\<item nazov=“button num 5” load="" image=""/\>[/LEFT]

[LEFT]\<item nazov=“button num 6” load="" image=""/\>[/LEFT]

[LEFT]\<item nazov=“button num 7 “load=”” image=""/\>[/LEFT]

[LEFT]\<item nazov=“button num 8” load="" image=""/\>[/LEFT]

[LEFT]\<item nazov=“button num 9” load="" image=""/\>[/LEFT]

[LEFT]\<item nazov=“button num 10” load="" image=""/\>[/LEFT]

[LEFT]\<item nazov=“button num 11” load="" image=""/\>[/LEFT]

[LEFT]\<item nazov=“button num 12” load="" image=""/\>[/LEFT]

[LEFT]And here is the actionscript[/LEFT]

[LEFT]\_parent.butts.alphaTo(50,1);[/LEFT]

[LEFT]function goFrame(mc):Void {  
delete this.onEnterFrame;  
if (mc.\_currentframe \< mc.\_totalframes) {  
mc.onEnterFrame = function() {  
mc.nextFrame();  
if (mc.\_currentframe == mc.\_totalframes) {  
delete mc.onEnterFrame;  
}  
};  
}  
}  
function backFrame(mc):Void {  
delete mc.onEnterFrame;  
mc.onEnterFrame = function() {  
mc.prevFrame();  
if (mc.\_currentframe == 1) {  
delete mc.onEnterFrame;  
}  
};  
}[/LEFT]

[LEFT]this.\_lockroot = true;[/LEFT]

[LEFT]menu1XML = new XML();  
menu1XML.ignoreWhite = true;  
menu1XML.load(“menu1.xml”);  
menu1XML.onLoad = function(success) {  
if (success) {  
keyNode = menu1XML.childNodes;  
pocet = keyNode.length;  
\_global.mnozstvo1 = pocet;  
\_global.riadok1 = 16;[/LEFT]

[LEFT]for (i = 0; i \< pocet; i++)  
{  
button.duplicateMovieClip(‘b’ + i, \_root.getNextHighestDepth());  
b = \_root[‘b’ + i];  
b.i = i;  
b.\_y += i \* \_global.riadok1;  
b.text2.text = menu1XML.childNodes\*.attributes.nazov;  
b.text1.text = menu1XML.childNodes\*.attributes.nazov;  
\_global.selecionado = 0;[/LEFT]

[LEFT]b.onRollOver = function()  
{  
var ID = this.\_y;  
var som:Sound = new Sound();  
som.attachSound(“som”);  
som.start();  
goFrame(this);  
pointermenu.tween("\_y",ID,1,“EaseOutExpo”);  
\_parent.vysunbtn1.tween("\_x",124,1,“EaseOutExpo”);  
\_parent.butts.alphaTo(100,1);  
};[/LEFT]

[LEFT]b.onRollOut = function()  
{  
backFrame(this);  
\_parent.vysunbtn1.tween("\_x",100,1,“EaseOutExpo”);  
\_parent.butts.alphaTo(50,1);  
};[/LEFT]

[LEFT]b.onRelease = function()  
{  
\_global.selecionado = this.i;  
this.enabled = false;  
this.useHandCursor = false;  
fcn();[/LEFT]

[LEFT]\_parent.\_parent.\_parent.content.tween("\_y",175,1," EaseOutExpo");  
\_parent.\_parent.\_parent.content.headcon.headert.te xt = “AHOJ”;  
backFrame(\_parent.\_parent.\_parent.content);  
goFrame(\_parent.\_parent.\_parent.content);[/LEFT]

[LEFT]\_global.section = menu1XML.childNodes[this.i].attributes.load;[/LEFT]

[LEFT]};  
unloadMovie(button);  
}  
}  
}[/LEFT]

[LEFT]function fcn()  
{  
for (i = 0; i \< pocet; i++)  
{  
if (i != selecionado)  
{  
\_root[‘b’ + i].enabled = true;  
\_root[‘b’ + i].useHandCursor = true;  
backFrame(\_root[‘b’ + i]);  
}  
}  
}[/LEFT]

[LEFT]this.onEnterFrame = function()  
{  
var pctLoaded:Number = Math.floor(menu1XML.getBytesLoaded() / menu1XML.getBytesTotal() \* 100);  
if (!isNaN(pctLoaded))  
{  
pointer.\_xscale = pctLoaded;  
pointer.text = pctLoaded + “% loaded”;  
if (pctLoaded \>= 100)  
{  
delete this.onEnterFrame;  
}  
}  
};[/LEFT]

[LEFT]THanks![/LEFT]

[/LEFT]
