stop();
var contentFile = “xmlstuff/menuContent.xml”;
var configFile = “xmlstuff/menuConfig.xml”;
contentXML = new XML();
configXML = new XML();
contentXML.varTarget = this;
configXML.ignoreWhite = contentXML.ignoreWhite = true;
contentXML.onLoad = function (success)
{
if (success)
{
var vt = this.varTarget;
var root = this.firstChild;
vt.menuObj = new Object();
var i, j, k, m, h, a;
(i = root.lastChild, j = 1);
while (i != null)
{
vt.menuObj[“item” + j] = new Object();
vt.menuObj[“item” + j].name = i.attributes.name;
vt.menuObj[“item” + j].action = typeof(i.attributes.action) == “undefined” ? null : i.attributes.action;
vt.menuObj[“item” + j].sub = false;
if (i.hasChildNodes())
{
vt.menuObj[“item” + j].sub = true;
(k = i.lastChild, m = 1);
while (k != null)
{
vt.menuObj[“item” + j][“sub” + m] = new Object();
vt.menuObj[“item” + j][“sub” + m].name = k.attributes.name;
vt.menuObj[“item” + j][“sub” + m].action = typeof(k.attributes.action) == “undefined” ? null : k.attributes.action;
vt.menuObj[“item” + j][“sub” + m].subsub = false;
if (k.hasChildNodes())
{
vt.menuObj[“item” + j][“sub” + m].subsub = true;
(h = k.lastChild, a = 1);
while (h != null)
{
vt.menuObj[“item” + j][“sub” + m][“subsub” + a] = new Object();
vt.menuObj[“item” + j][“sub” + m][“subsub” + a].name = h.attributes.name;
vt.menuObj[“item” + j][“sub” + m][“subsub” + a].action = h.attributes.action;
(h = h.previousSibling);
a++;
}
vt.menuObj[“item” + j][“sub” + m].Number_SubSubs = a - 1;
}
(k = k.previousSibling);
m++;
}
vt.menuObj[“item” + j].Number_Subs = m - 1;
}
(i = i.previousSibling);
j++;
}
_global.Number_Items = j - 1;
vt.play();
}
else
{
trace(“ERROR PARSING XML”);
}
};
function loadContent()
{
contentXML.load(contentFile);
}
configXML.onLoad = function (success)
{
if (success)
{
var root = this.firstChild;
configObj = new Object();
configObj.menuSpeed = root.attributes.menuSpeed;
configObj.menuSpacer = root.attributes.menuSpacer;
configObj.colorSpeed = root.attributes.colorSpeed;
allLevels = root.childNodes;
for(var i=0; i<allLevels.length; i++)
{
configObj[allLevels*.nodeName] = new Object;
configObj[allLevels*.nodeName].overColor = allLevels*.attributes.overColor;
configObj[allLevels*.nodeName].outColor = allLevels*.attributes.outColor;
configObj[allLevels*.nodeName].delay = allLevels*.attributes.delay;
}
loadContent();
}
else
{
trace(“ERROR PARSING XML”);
}
}
configXML.load(configFile)