Any body knows why the code below would work in 7 and not when published as fl 8. What it does is onRelease it makes a submenu but for some reason it is not functioning. Thanks In advance for your help.
//Load Xml
myXML = new XML();
myXML.ignoreWhite = true;
myXML.load("xml/menu.xml");
//Check if its loaded successfully
function handleLoad(status) {
status ? makeMenu() : trace("Error parsing XML.");
}
myXML.onLoad = handleLoad;
//Build Menu headings
function makeMenu() {
//limkage name of btn mc clip
myItem = "heading";
myX = 0;
myY = 0;
//goto the first heading node and count the number of menu
//heading nodes
for (i=0; i<myXML.firstChild.childNodes.length; i++) {
//get id node value and assign each heading btnLabel
//var
btnLabel = (myXML.firstChild.childNodes*.attributes.id);
// create a new headings item to the id value of the heading
this.attachMovie(myItem, btnLabel, i+10);
thisItem = this[btnLabel];
//change the heading id value of the heading
thisItem.btnLabel = (btnLabel);
thisItem._x = myX += (thisItem._width)+2;
thisItem._y = myY;
thisItem.onRelease = function() {
xPos = this._x;
yPos = this._y;
makeSubMenu(this.btnLabel, xPos, yPos);
};
}
}
//subMenu
function makeSubMenu(subMenuID, xPos, yPos) {
subItem = "subMenu";
unloadSubMenu();
itemsLoaded = new Array();
for (i=0; i<myXML[subMenuID].childNodes.length; i++) {
btnSubLabel = (myXML[subMenuID].childNodes*.attributes.id);
link = (myXML[subMenuID].childNodes*.attributes.link);
this.attachMovie(subItem, btnSubLabel, i+100);
thisItem = this[btnSubLabel];
itemsLoaded.push(btnSubLabel);
thisItem.btnSubLabel = (btnSubLabel);
thisItem.link = (link);
thisItem._x = xPos;
thisItem._y = yPos += (thisItem._height);
}
thisItem.onRelease = function() {
openLink(this.link);
};
}
[/AS]