Grazie Crescenzo!
Ci sono però due piccole "disfunzioni":
[list=a][*]la barretta si allarga troppo e si posiziona un po' più a destra rispetto al bottone sotto cui si trova. Ecco qui l'swf.[*]la barretta, che dopo due secondi torna sul bottone che è stato cliccato per ultimo, ci torna con le dimensioni che ha acquisito dal bottone sotto cui è passata... è un po' un casino... Per farvi capire meglio, cliccate ad esempio su "Contatti" e dopo spostate il mouse su "Prodotti e Linee": la barretta torna sotto "Contatti" ma con le dimensioni di "Prodotti e Linee"[/list=a]
Inoltre il comando trace(mc1._width) mi dà errore e quindi non l'ho inserito... può darsi che sia qui l'errore.
Mi sono anche dimenticata di dire che uso Flash MX...
Posto il codice che ho usato: dove devo intervenire?
codice:
function tuttoComePrima() {
pos = _root.menuCliccato._x;
larg = _root.menuCliccato._width;
delete riquadro.onEnterFrame;
riquadro.onEnterFrame = function(){
this._x = this._x+(pos-this._x)/7;
if (pos == Math.round(this._x)) {
this._x = pos;
delete this.onEnterFrame;
}
};
clearInterval(a);
}
_root.menuCliccato = mc1;
tuttoComePrima();
mc1.onRollOver = function() {
clearInterval(a);
pos = this._x;
delete this.onEnterFrame;
riquadro.onEnterFrame = function() {
this._x = this._x+(pos-this._x)/7;
if (pos == Math.round(this._x)) {
this._x = pos;
delete this.onEnterFrame;
}
};
};
mc1.onRollOver = function() {
clearInterval(a);
pos = this._x;
delete this.onEnterFrame;
riquadro.onEnterFrame = function() {
this._x = this._x+(pos-this._x)/7;
riquadro._width=mc1._width;
if (pos == Math.round(this._x)) {
this._x = pos;
delete this.onEnterFrame;
}
};
};
mc1.onRollOut = function() {
a = setInterval(tuttoComePrima, 2000);
};
mc1.onRelease = function(){
_root.menuCliccato = this;
}
mc2.onRollOver = function() {
clearInterval(a);
pos = this._x;
delete this.onEnterFrame;
riquadro.onEnterFrame = function() {
this._x = this._x+(pos-this._x)/7;
riquadro._width=mc2._width;
if (pos == Math.round(this._x)) {
this._x = pos;
delete this.onEnterFrame;
}
};
};
mc2.onRollOut = function() {
a = setInterval(tuttoComePrima, 2000);
};
mc2.onRelease = function(){
_root.menuCliccato = this;
}
mc3.onRollOver = function() {
clearInterval(a);
pos = this._x;
delete this.onEnterFrame;
riquadro.onEnterFrame = function() {
this._x = this._x+(pos-this._x)/7;
riquadro._width=mc3._width;
if (pos == Math.round(this._x)) {
this._x = pos;
delete this.onEnterFrame;
}
};
};
mc3.onRollOut = function() {
a = setInterval(tuttoComePrima, 2000);
};
mc3.onRelease = function(){
_root.menuCliccato = this;
}
mc4.onRollOver = function() {
clearInterval(a);
pos = this._x;
delete this.onEnterFrame;
riquadro.onEnterFrame = function() {
this._x = this._x+(pos-this._x)/7;
riquadro._width=mc4._width;
if (pos == Math.round(this._x)) {
this._x = pos;
delete this.onEnterFrame;
}
};
};
mc4.onRollOut = function() {
a = setInterval(tuttoComePrima, 2000);
};
mc4.onRelease = function(){
_root.menuCliccato = this;
}
mc5.onRollOver = function() {
clearInterval(a);
pos = this._x;
delete this.onEnterFrame;
riquadro.onEnterFrame = function() {
this._x = this._x+(pos-this._x)/7;
riquadro._width=mc5._width;
if (pos == Math.round(this._x)) {
this._x = pos;
delete this.onEnterFrame;
}
};
};
mc5.onRollOut = function() {
a = setInterval(tuttoComePrima, 2000);
};
mc5.onRelease = function(){
_root.menuCliccato = this;
}