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();
      };
}
LVL 1
unluckynelsonAsked:
Who is Participating?
 
rascalpantsCommented:
don't use onMouseDown...

use onRelease


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

see if that makes a difference


rp
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
unluckynelsonAuthor Commented:
Thanks, I will...
Do you also maybe know why onRollOut doesn't always execute? leaving my buttons on a rollover state...
0
 
rascalpantsCommented:
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
0
 
unluckynelsonAuthor Commented:
Aaah, yes, you're right... It was that...
Thanks a million!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.