Skip to main content
Participating Frequently
May 29, 2009
Answered

ActionScript 2 Issue: Menu Buttons not disappearing

  • May 29, 2009
  • 2 replies
  • 547 views

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!

This topic has been closed for replies.
Correct answer kglad

in scan_btn's rollover you have:

myTween1 = new Tween(scan_large,"_x",Regulare.easeOut,startX,startX+10,6,false);

is that supposed to be:

myTween2 = new Tween(scan_large,"_x",Regulare.easeOut,startX,startX+10,6,false);

2 replies

kglad
Community Expert
Community Expert
May 29, 2009

if that didn't solve the problem, check for other typos in the rest of your code.

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
May 29, 2009

in scan_btn's rollover you have:

myTween1 = new Tween(scan_large,"_x",Regulare.easeOut,startX,startX+10,6,false);

is that supposed to be:

myTween2 = new Tween(scan_large,"_x",Regulare.easeOut,startX,startX+10,6,false);

brumery11Author
Participating Frequently
May 29, 2009

in scan_btn's rollover you have:

myTween1 = new Tween(scan_large,"_x",Regulare.easeOut,startX,startX+10,6,false);

is that supposed to be:

myTween2 = new Tween(scan_large,"_x",Regulare.easeOut,startX,startX+10,6,false);

oh yes, thanks for point that out!