Link to home
Start Free TrialLog in
Avatar of unluckynelson
unluckynelsonFlag for South Africa

asked on

Flash MouseDown event not working as expected....

Hi All
I have a row of flash buttons that run on RollOver and RollOut and MouseDown events... most of it works fine but when I click on one of the mc's with a totally different name, all the mousedown functions are called... What am I doing wrong?

if (CurrentPage=="home") {
      trace(CurrentPage);
      home_mc.gotoAndStop(4);
} else {
      this.home_mc.onRollOver = function() {
            home_mc.gotoAndStop(2);
            home_mc.home_hover_mc.play();
            trace('Hovering');
      };
      this.home_mc.onMouseDown = function() {
            home_mc.gotoAndPlay(3);
            trace('Home Clicking');
      };
      this.home_mc.onRollOut = function() {
            home_mc.home_hover_mc.play();
      };
}
if (CurrentPage=="products") {
      trace(CurrentPage);
      products_mc.gotoAndStop(4);
} else {
      this.products_mc.onRollOver = function() {
            products_mc.gotoAndStop(2);
            products_mc.products_hover_mc.gotoAndPlay(1);
            trace('Hovering');
      };
      this.products_mc.onMouseDown = function() {
            products_mc.gotoAndPlay(3);
            trace('Clicking');
      };
      this.products_mc.onRollOut = function() {
            products_mc.products_hover_mc.play();
      };
}
ASKER CERTIFIED SOLUTION
Avatar of rascalpants
rascalpants
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of unluckynelson

ASKER

Aaah, thanx, you're a genius...
WTH's MouseDown for then anyway....
also, you may want to change your gotoAndPlay(3)  to gotoAndStop(3)

see if that makes a difference


rp
Thanks, I will...
Do you also maybe know why onRollOut doesn't always execute? leaving my buttons on a rollover state...
it most likely has something to do with your timeline for home_mc.home_hover_mc

you are using a play()  method...  most likely you should be using a gotoAndPlay()  or gotoAndStop()

because when ever you trigger the play() method, it may be in the middle of a timeline action when you rollOut.

rp
Aaah, yes, you're right... It was that...
Thanks a million!