Ho scaricato (sorry tempo fà...non mi ricordo dove) un menù in stile yugop.com, siccome non vi erano indicazioni di come passare da un frame all'altro...in fondo ho aggiunto del codice per andare appunto al fr1 e fr2.
IL PROBLEMA: Il MC con istanza "visited" non viene considerato assonciando l'azione di spostamento ad un altro frame, come si può risolvere?
qui il codice principale:
codice:
/* EagleEyed :: 2004 */
Stage.scaleMode = "noScale";
// modificare questo array per cambiare il numero e i nomi dei pulsanti
labels = ['HOME', 'ABOUT ME', 'PORTFOLIO', 'DOWNLOADS', 'CONTACT', 'GUESTBOOK'];
// posizione
x = 60;
y = 25;
// distanza tra ogni mc
dist = 1;
// larghezza al rollOver e velocità di apertura
openWid = 100;
speed = 10;
MovieClip.prototype.scala = function(w, vel)
{
vel = w > this._width ? vel : -vel;
this.onEnterFrame = function()
{
if (this._width == w) {
delete this.onEnterFrame;
} else {
this._width = (Math.abs(this._width - w) > Math.abs(vel)) ? this._width + vel : w;
}
mc0._x = x;
this._parent.visited._x = this._width - mcWid;
for (i = 1; i < labels.length; i++) {
_root['mc' + i]._x = _root['mc' + (i - 1)]._x + _root['mc' + (i - 1)]._width + dist;
}
};
};
obj = {};
obj.onRollOver = function()
{
trace("Questo è il " + this._name);
this.bt.gotoAndStop('over');
_root[temp].bt.scala(mcWid, speed);
this.bt.scala(openWid, speed);
path = this;
clearInterval(id);
_root[temp].txt.text = '0' + (Number(_root[temp]._name.substring(2)) + 1);
clearInterval(pausa);
pausa = setInterval(function ()
{
randomChar(path.txt, labels[path._name.substring(2)]);
clearInterval(pausa);
}, 200);
};
obj.onRollOut = function()
{
clearInterval(pausa);
clearInterval(id);
this.bt.gotoAndStop('up');
_root[temp].bt.scala(openWid, speed);
this.bt.scala(mcWid, speed);
pausa = setInterval(function ()
{
randomChar(_root[temp].txt, labels[_root[temp]._name.substring(2)]);
clearInterval(pausa);
}, 200);
this.txt.text = '0' + (Number(this._name.substring(2)) + 1);
};
obj.onRelease = function()
{
_root[temp].txt.text = '0' + (Number(_root[temp]._name.substring(2)) + 1);
_root[temp].bt.gotoAndStop('up');
_root[temp].enabled = true;
_root[temp].bt.scala(mcWid, speed);
this.enabled = false;
temp = this._name;
this.visited._visible = true;
};
for (var i = 0; i < labels.length; i++) {
attachMovie('mc', 'mc' + i, i, obj);
trace("Creato mc" + i);
mcWid = mc0.bt._width;
this['mc' + i]._x = i * (mcWid + dist) + x;
this['mc' + i]._y = y;
this['mc' + i].txt.text = '0' + (i + 1);
this['mc' + i].txt.autoSize = true;
this['mc' + i].visited._visible = false;
}
//------------------------------------------------> ARN
added mc0.onRelease = function()
{
_root.gotoAndStop(1);
};
mc1.onRelease = function()
{
_root.gotoAndStop(2);
};
PS- Cosa è successo al forum ora lo vedo enorme !