Sono disperato!
Non riesco a capire che cosa non funziona in questo codice. In parole povere
le voci del sottomenù non si linkano... Magari si tratta di una
sovvrapposizione di Mcs ma non so come fare per ovviare al problema.
È la terza volta che scrivo... Nessuno mi sa dare una risposta Per Favore???
Grazie a chiunque mi aiuterà!!!
Codice:
---------------------------------------------------
codice:
menuXml = new XML ();
menuXml.ignoreWhite = true;
menuXml.load ("menu.xml");
menuXml.onLoad = function (success) {
if (success) {
menuItem = this.firstChild.childNodes;
xo = 0
for (var i = 0; i < menuItem.length; i++) {
xo = xo + 1
trace(xo)
item = _root.attachMovie ("itemClip", "itemClip" +i, 8+i);
//trace(item);
item._x = 108 * i;
item._y = 108;
item.itemLabel.text = menuItem[i].attributes.name;
//item.itemLabel.htmlText = ""+menuItem[i].attributes.name+"";
item.menuUrl = menuItem[i].attributes.url;
item.node = menuItem[i].childNodes;
item.onRollOver = function () {
clearClicked (clicked);
clicked = this;
submenu (this.node, this);
//trace(itemClip);
bg = this.attachMovie("bg", "bg"+i, i);
trace(bg)
bg._x = 4;
bg._y = 4;
bg._visible=1
};
item.onRollOut = function () {
bg._visible = 0
SubItemClip.removeMovieClip()
};
item.onRelease = function () {
getURL (this.menuUrl);
trace("item");
};
}
}
};
function submenu (node, itemClip) {
for (var j = 0; j < node.length; j++) {
subitem = itemClip.attachMovie ("SubItemClip", "SubItemClip" + 100+j,
8+j);
//trace(subitem)
subitem._x = 0;
subitem.y = -(j * (subitem._height - 2)) - 12;
subitem.t = j*150
subitem.t1 = getTimer();
subitem._visible = 0;
subitem.onEnterFrame = function() {
if(getTimer() -this.t1 > this.t) {
this._visible = 1
this._y += (this.y-this._y)/1.5
if(Math.abs(this.y-this._y) < .1)
{
this._y = this.y
delete this.onEnterFrame
}
}
};
subitem.SubItemLabel.text = node[j].attributes.name;
subitem.submenuUrl = node[j].attributes.url;
subitem.onRelease = function() {
trace("subitem");
subitem.getURL(this.submenuUrl);
trace(this.submenuUrl);
};
}
}
function clearClicked (obj) {
for (var a in obj) {
obj[a].onEnterFrame = function()
{
this._y += (-10-this._y)/1.5
if(Math.abs(-10-this._y) < .1)
{
this.removeMovieClip();
delete this.onEnterFrame
}
}
}
}