Ciao Maz3us,creati i bottoni del menu ed istanziali 'mc1','mc2','mc3','mc4', creati l'oggetto che deve seguire il mouse e istanzialo 'riquadro', poi sul frame metti:
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;
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;
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;
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;
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;
}
CTRL+ENTER...
ps: non prenderla come abitudine.......
ciao