ciao and grazie per la dritta e per la risposta
ho provato ma non funziona
io ho un mc menu e nel suo interno ho questo codice
codice:
this._lockroot=true ;
MovieClip.prototype.animate = function ()
{
this.gotoAndStop(1);
this.onRollOver = function ()
{
this.playTo(this._totalframes);
this._onRollOver();
};
this.onRollOut = function ()
{
this.playTo(1);
this._onRollOut();
};
this.onReleaseOutside = this.onRollOut;
};
MovieClip.prototype.playTo = function (frame)
{
if (this.onEnterFrame != undefined)
{
delete this.onEnterFrame;
} // end if
this.onEnterFrame = function ()
{
if (frame == this._currentframe)
{
delete this.onEnterFrame;
}
else if (frame < this._currentframe)
{
this.gotoAndStop(this._currentframe - 1);
}
else
{
this.gotoAndStop(this._currentframe + 1);
} // end else if
};
};
MovieClip.prototype.goTo = function (xpos, ypos)
{
if (this.onEnterFrame != undefined)
{
delete this.onEnterFrame;
} // end if
var xdone = false;
var ydone = false;
this.onEnterFrame = function ()
{
if (Math.abs(ypos - this._y) > 5.000000E-001)
{
this._y = this._y + (ypos - this._y) / 9;
}
else
{
ydone = true;
} // end else if
if (Math.abs(xpos - this._x) > 5.000000E-001)
{
this._x = this._x + (xpos - this._x) / 9;
}
else
{
xdone = true;
} // end else if
if (xdone && ydone)
{
delete this.onEnterFrame;
this._x = xpos;
this._y = ypos;
this.onGoFinish();
} // end if
};
};
Stage.align = "TL";
Stage.scaleMode = "noScale";
Stage.showMenu = false;
loader_mc._x = Math.round((Stage.width - loader_mc._width) / 2);
stop ();
if (xml == undefined)
{
xml = "data.xml";
} // end if
var xmlOb = new XML();
xmlOb.ignoreWhite = true;
xmlOb.onLoad = function ()
{
_root.menu.onEnterFrame = function ()
{
if (_root.menu.getBytesLoaded() == _root.menu.getBytesTotal())
{
delete _root.menu.onEnterFrame;
play ();
} // end if
};
};
xmlOb.load(xml);
2 fotogramma
codice:
this._lockroot=true ;
stop ();
var dat = new Array();
var n = xmlOb.firstChild.firstChild;
while (n != null)
{
if (n.nodeName == "file")
{
var cob = new Object();
for (var i in n.childNodes)
{
var m = n.childNodes[i];
cob[String(m.nodeName)] = String(m.firstChild.nodeValue);
} // end of for...in
dat.push(cob);
} // end if
n = n.nextSibling;
} // end while
mask_mc._width = Stage.width;
mask_mc._height = Stage.height;
hit_mc._width = Stage.width;
hit_mc._height = Stage.height;
hit_mc._alpha = 0;
container_mc.setMask(mask_mc);
var cm = container_mc;
var erxi;
var erxf;
var j = 0;
while (j < dat.length)
{
var d = cm.getNextHighestDepth();
var ct = cm.attachMovie("thumbnail", "t" + j, d);
ct.animate();
ct._y = 12;
ct.pic_mc.picHolder_mc.loadMovie(dat[j].image);
ct.ref_mc.picHolder_mc.loadMovie(dat[j].image);
ct.label_mc.label_txt;
ct.label_mc.label_txt.autoSize = "center";
ct.label_mc.label_txt.wordWrap = false;
ct.label_mc.label_txt.multiline = false;
ct.label_mc.label_txt.text = dat[j].title;
if (j == 0)
{
erxi = Math.round((ct.label_mc.label_txt._width - 58) / 2);
if (erxi < 0)
{
erxi = 0;
} // end if
} // end if
if (j == dat.length - 1)
{
erxf = Math.round((ct.label_mc.label_txt._width - 58) / 2);
if (erxf < 0)
{
erxf = 0;
} // end if
} // end if
ct._x = erxi + 12 + 43 * j;
ct.__url = dat[j].url;
ct.onRelease = function ()
{
getURL(this.__url, "");
trace (this.label_mc.label_txt.text);
};
ct._onRollOver = function ()
{
this.swapDepths(this._parent.getNextHighestDepth());
};
++j;
} // end while
var w = 24 + erxi + erxf + 43 * dat.length;
trace (w);
container_mc._x = Math.round((Stage.width - w) / 2);
_root.onMouseMove = function ()
{
if (!hit_mc.hitTest(_root.menu._xmouse, _root.menu._ymouse, true) || w <= hit_mc._width)
{
return;
} // end if
var _loc2 = _root.menu._xmouse < 64 ? (64) : (_root.menu._xmouse > hit_mc._width - 64 ? (hit_mc._width - 64) : (_root.menu._xmouse));
_loc2 = _loc2 - 64;
var _loc4 = hit_mc._width - w;
var _loc3 = Math.floor(_loc2 * _loc4 / (hit_mc._width - 128));
container_mc.goTo(_loc3, 0);
};
se metto i componenti contenuti in menu nello stag funziona tutto altrimenti non va