Buonasera a tutti,
ho realizzato questo script AS, però ho un problema.
Vorrei che al primo click tutti i submenù non siamo più visibili
Sto impazzendo!!!
Allego il codice As.
_root.menu.sub1._x = 280;
_root.menu.sub2._x = 280;
//variabili che controllano lo "stato del click" ...
_root.numClick = false;
_root.numClick1 = false;
_root.numClick2 = false;
_root.numClick2 = false;
var dec = 5;
function Sposta(controlloPos) {
if (controlloPos) {
this.sub1.onEnterFrame = function() {
_root.menu.sub1._x = _root.menu.sub1._x+(-218-_root.menu.sub1._x)/dec;
};
} else {
this.sub1.onEnterFrame = function() {
_root.menu.sub1._x = _root.menu.sub1._x+(280-_root.menu.sub1._x)/dec;
};
}
}
function Sposta_2(controlloPos) {
if (controlloPos) {
this.sub2.onEnterFrame = function() {
_root.menu.sub2._x = _root.menu.sub2._x+(-84-_root.menu.sub2._x)/dec;
};
} else {
this.sub2.onEnterFrame = function() {
_root.menu.sub2._x = _root.menu.sub2._x+(280-_root.menu.sub2._x)/dec;
};
}
}
function Sposta_3(controlloPos) {
if (controlloPos) {
this.sub3.onEnterFrame = function() {
_root.menu.sub3._x = _root.menu.sub3._x+(-352-_root.menu.sub3._x)/dec;
};
} else {
this.sub3.onEnterFrame = function() {
_root.menu.sub3._x = _root.menu.sub3._x+(280-_root.menu.sub3._x)/dec;
};
}
}
function Sposta_4(controlloPos) {
if (controlloPos) {
this.sub4.onEnterFrame = function() {
_root.menu.sub4._x = _root.menu.sub4._x+(65-_root.menu.sub4._x)/dec;
};
} else {
this.sub4.onEnterFrame = function() {
_root.menu.sub4._x = _root.menu.sub4._x+(280-_root.menu.sub4._x)/dec;
};
}
}
this.squadre.onRelease = function() {
if (_root.numClick) {
_root.numClick = false;
Sposta(false);
} else {
_root.numClick = true;
Sposta(true);
}
};
this.stagione.onRelease = function() {
if (_root.numClick1) {
_root.numClick1 = false;
Sposta_2(false);
} else {
_root.numClick1 = true;
Sposta_2(true);
}
};
this.chisiamo.onRelease = function() {
if (_root.numClick2) {
_root.numClick2 = false;
Sposta_3(false);
} else {
_root.numClick2 = true;
Sposta_3(true);
}
};
this.community.onRelease = function() {
if (_root.numClick3) {
_root.numClick3 = false;
Sposta_4(false);
} else {
_root.numClick3 = true;
Sposta_4(true);
}
};

Rispondi quotando