Hi cofighters

after there were so many requests for dynamic button creation, I put a small hint together for dynamic Button getting there Detaildata from XML.
AS-Code ist this:
[font=Verdana color=blue]
function menuepoint(xmlData){
this.label=xmlData.firstchild.attributes.label;
this.page=xmlData.firstchild.attributes.page;
this.xpos=xmlData.firstchild.attributes.x;
this.ypos=xmlData.firstchild.attributes.y;
this.level=xmlData.firstchild.attributes.level;
attachMovie("menuepointMC",this.label,this.level);
eval(this.label)._x=this.xpos;
eval(this.label)._y=this.ypos;
eval(this.label).label.text=this.label;
eval(this.label).func.text=this.page;
eval(this.label).onRelease=exec;
}
function exec(){
getURL(this.page.text,"_mainFrame","POST");
}
[/font]
you need to make a movieclip with the name menuepiont, havin a textbox named label and a hidden textbox named page.
Thats more or less it.
if you feed each instance of the button with a XML-Datastream, you can run a dynamic menue.
Sample:
menueXML="<menue label=\"HOME\" page=\"home.html\" x=\"10\" y=\"200\" level=\"10\"/>"
l1=new XML(MenueXML);
m1=new menuepoint(l1);
In real life you would read the menueXML out of a XML data stream

and then you dont need these two extra steps preparing the XML data.
Have fun with it