Okay I am going on week 2 of working on this blasted dropdown menu. There are 9 buttons on the main navigation. I have 3 of the button dropdowns working. Everything seems to work fine, but if I mouseOver and mouseOut really fast the dropdowns will stay in the down positions and not come back up. Could you check out my code and see if there is anything that might be causing this.
here is the swf link: http://upwardstudios.com/test/banner.html
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
_global.front;
_global.intTime = 50;
_global.down = false;
_global.down3 = false;
_global.down4 = false;
////////////////////////////////
///Functions////////////////////
////////////////////////////////
function menuopen(but, drop, end) {
var butin:Tween = new Tween(but, "_alpha", Strong.easeOut, 0, 12, .5, true);
var butopen:Tween = new Tween(drop, "_y", Strong.easeOut, -219, end, .3, true);
};
function menuclose() {
var butin:Tween = new Tween(b1, "_alpha", Strong.easeOut, 12, 0, .5, true);
var butclose:Tween = new Tween(d1, "_y", Strong.easeOut, 0, -225, .3, true);
clearInterval(_global.b1int);
_global.down = false;
};
function menuclose3() {
var butin3:Tween = new Tween(b3, "_alpha", Strong.easeOut, 12, 0, .5, true);
var butclose3:Tween = new Tween(d3, "_y", Strong.easeOut, -65, -225, .3, true);
clearInterval(_global.b3int);
_global.down3 = false;
};
function menuclose4() {
var butin4:Tween = new Tween(b4, "_alpha", Strong.easeOut, 12, 0, .5, true);
var butclose4:Tween = new Tween(d4, "_y", Strong.easeOut, -55, -225, .3, true);
clearInterval(_global.b4int);
_global.down4 = false;
};
///////////////////////////////////
///Button Actions//////////////////
///////////////////////////////////
//dropdown 1 start
b1.onRollOver = function() {
if(_global.b1int != null){ clearInterval(_global.b1int); }
if(_global.down == false) {
_root.d1.swapDepths(_global.front);
menuopen(this, d1, 0);
_global.down = true;
_global.front = d1;
}
};
b1.onRollOut = function() {
_global.b1int = setInterval(menuclose, _global.intTime);
};
b1.onReleaseOutside = function() {
_global.b1int = setInterval(menuclose, _global.intTime);
};
d1.d1stop.onRollOver = function() {
clearInterval(_global.b1int);
};
d1.d1stop.onRollOut = function() {
_global.b1int = setInterval(_root.menuclose, _global.intTime);
};
d1.d1stop.onReleaseOutside = function() {
_global.b1int = setInterval(_root.menuclose, _global.intTime);
};
var i:Number = 1;
onEnterFrame = function(){
with(d1){
eval("b"+i).onRollOver = function() {
if(_global.b1int != null){ clearInterval(_global.b1int); }
};
eval("b"+i).onReleaseOutside = function() {
_global.b1int = setInterval(_root.menuclose, _global.intTime);
};
i++;
}
if(i == 10){ delete this.onEnterFrame; }
}
//dropdown 3 start
b3.onRollOver = function() {
if(_global.b3int != null){ clearInterval(_global.b3int); }
if(_global.down3 == false) {
_root.d3.swapDepths(_global.front);
menuopen(this, d3, -75);
_global.down3 = true;
_global.front = d3;
}
};
b3.onRollOut = function() {
_global.b3int = setInterval(menuclose3, _global.intTime);
};
b3.onReleaseOutside = function() {
_global.b3int = setInterval(menuclose3, _global.intTime);
};
d3.d3stop.onRollOver = function() {
clearInterval(_global.b3int);
};
d3.d3stop.onRollOut = function() {
_global.b3int = setInterval(_root.menuclose3, _global.intTime);
};
d3.d3stop.onReleaseOutside = function() {
_global.b3int = setInterval(_root.menuclose3, _global.intTime);
};
var z:Number = 1;
d3.onEnterFrame = function(){
with(this){
eval("d"+i).onRollOver = function() {
if(_global.b3int != null){ clearInterval(_global.b3int); }
};
eval("d"+i).onReleaseOutside = function() {
_global.b3int = setInterval(_root.menuclose3, _global.intTime);
};
z++;
}
if(z == 7){ delete this.onEnterFrame; }
}
//dropdown 4 start
b4.onRollOver = function() {
clearInterval(_global.b4int);
if(_global.down4 == false) {
_root.d4.swapDepths(_global.front);
menuopen(this, d4, -55);
_global.down4 = true;
_global.front = d4;
}
};
b4.onRollOut = function() {
_global.b4int = setInterval(menuclose4, _global.intTime);
};
b4.onReleaseOutside = function() {
_global.b4int = setInterval(menuclose4, _global.intTime);
};
d4.d4stop.onRollOver = function() {
clearInterval(_global.b4int);
};
d4.d4stop.onRollOut = function() {
_global.b4int = setInterval(_root.menuclose4, _global.intTime);
};
d3.d4stop.onReleaseOutside = function() {
_global.b4int = setInterval(_root.menuclose4, _global.intTime);
};
var c:Number = 1;
d4.onEnterFrame = function(){
with(this){
eval("b"+c).onRollOver = function() {
if(_global.b4int != null){ clearInterval(_global.b4int); }
};
eval("b"+c).onReleaseOutside = function() {
_global.b4int = setInterval(_root.menuclose4, _global.intTime);
};
c++;
}
if(c == 8){ delete this.onEnterFrame; }
}
///////////////////////
///Side Link Buttons///
///////////////////////
var w:Number = 1;
a1.onEnterFrame = function(){
var ar:MovieClip = eval("a"+w);
eval("s"+w).onRollOver = function() {
var amove:Tween = new Tween(ar, "_x", Strong.easeOut, 29, 39, .3, true);
};
eval("s"+w).onRollOut = function() {
var amove:Tween = new Tween(ar, "_x", Strong.easeOut, 39, 29, .3, true);
};
eval("s"+w).onReleaseOutside = function() {
var amove:Tween = new Tween(ar, "_x", Strong.easeOut, 39, 29, .3, true);
};
if(w == 6){ delete this.onEnterFrame; }
w++;
};