The attribute link in this code is to navigate in Flash and it’s working very good! I now want the font color of the buttons to change on rollOver. This is the AC i have in my Flash movie:
You don’t need to do anything to your XML code. Just use the TextFormat() object in Flash to set the color.
[AS]stop();
//create overColor textFormat
overColor = new TextFormat();
//set the color to red
overColor.color = 0xFF0000;
//create standardColor textFormat
standardColor = new TextFormat();
//set the color to black
standardColor.color = 0x000000;
menuXml = new XML();
menuXml.ignoreWhite =true;
menuXml.onload = function(success){
if(success){
menuItem=this.firstChild.childNodes;
for(x=0;x<menuItem.length;x++){
item=_root.attachMovie(“myMovie”,“myMovie”+x,x);
item._root[“myMovie”+x]._x=(x*150)+50;
item._root[“myMovie”+x]._y=50;
item.itemLabel.text=menuItem[x].attributes.titel;
item.myLink = menuItem[x].attributes.link;
//onRollOver of the clip
item.onRollOver = function(){
//set the textformat of the itemLabel textfield to the overColor textformat object
this.itemLabel.setTextFormat(overColor);
}
//onRollOut of the clip
item.onRollOut = function(){
//set the textformat of the itemLabeltextfield back to the original color using the standardColor textformat object
this.itemLabel.setTextFormat(standardColor);
}
item.onRelease = function() {
gotoAndStop(this.myLink);
}
}
}
}
menuXml.load(“myMenu.xml”);[/AS]
Note: I didn’t test this, but the theory is still there if you want to expand on it.
Thks for the code. I never thought of that. It’s working but there is one problem. Only the last one in the line is working, so no mather over witch button I move only the Contact button is getting red and the same happen onRollOut. Is this because I didn’t declared it in XML? In other words it seems to me that the Loop isn’t made and that Flash see Contact as the current element?
Submenus are quite difficult to add. I am sorry, but I don’t have the time to figure out how to do that for you.
However, I did write an XML Menu once, then the flash god Senocular took over and made it able to be “sub-menued”, if you want to check that out you can find it here…
[edit]your .zip file only contained the .xml file So I wouldn’t of been able to help much with the text problem anyway so I am glad you figured that out on your own [/edit]