ActionScript 2 Issue: Menu Buttons not disappearing
Hey everyone, I'm an intern who was asked to take on a flash project. I have knowledge of HTML but this is my first flash project, and I think I'm way over my head. I followed a tutorial explaining how to make menu buttons and I realized that the actionscript for a drop down menu should work for what I'm trying to do. So I finally have everything the way I want it but I'm pretty sure I have a bit of wasted code in there. Now, my issue is when I play my flash and move my mouse really fast over the flash object sometimes two menu buttons appear. I'm sure it is because of the ._alpha > 0 code I'm using but I dont know another way around it. If you have any advice PLEASE share!! Here is a link to the swf file...http://www.rumeryrefinishing.com/MVS%20Flash%20Project.html
This is the code (for two buttons) I use to make something disappear when I RollOver another button:
calplate_btn.onRollOver = function () {
if(scan_large._x > startX) {
myTweenB.stop();
myTween2.stop();
scan_large.enabled = false
scan_large._alpha = 0
scan_large._x = startX
}
if(scan_large._alpha > 0 ) {
myTweenB.stop();
myTween2.stop();
scan_large.enabled = false
scan_large._alpha = 0
scan_large._x = startX
}
calplate_large.enabled = true;
myTweenA = new Tween(calplate_large,"_alpha",Regular.easeOut,0,100,6,false);
myTween1 = new Tween(calplate_large,"_x",Regulare.easeOut,startX,startX+10,6,false);
}
__________________________________________________________________________________
scan_btn.onRollOver = function () {
if(calplate_large._x > startX) {
myTweenA.stop();
myTween1.stop();
calplate_large.enabled = false
calplate_large._alpha = 0
calplate_large._x = startX
}
if(calplate_large._alpha > 0 ) {
myTweenA.stop();
myTween1.stop();
calplate_large.enabled = false
calplate_large._alpha = 0
calplate_large._x = startX
}
scan_large.enabled = true;
myTweenB = new Tween(scan_large,"_alpha",Regular.easeOut,0,100,6,false);
myTween1 = new Tween(scan_large,"_x",Regulare.easeOut,startX,startX+10,6,false);
}
__________________________________________________________________________________
Also, if its not too much to ask, please let me know If I can compress some of the actionscript code!