unluckynelson
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.onRollOve r = function() {
products_mc.gotoAndStop(2) ;
products_mc.products_hover _mc.gotoAn dPlay(1);
trace('Hovering');
};
this.products_mc.onMouseDo wn = function() {
products_mc.gotoAndPlay(3) ;
trace('Clicking');
};
this.products_mc.onRollOut = function() {
products_mc.products_hover _mc.play() ;
};
}
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.onRollOve
products_mc.gotoAndStop(2)
products_mc.products_hover
trace('Hovering');
};
this.products_mc.onMouseDo
products_mc.gotoAndPlay(3)
trace('Clicking');
};
this.products_mc.onRollOut
products_mc.products_hover
};
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
also, you may want to change your gotoAndPlay(3) to gotoAndStop(3)
see if that makes a difference
rp
see if that makes a difference
rp
ASKER
Thanks, I will...
Do you also maybe know why onRollOut doesn't always execute? leaving my buttons on a rollover state...
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
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
ASKER
Aaah, yes, you're right... It was that...
Thanks a million!
Thanks a million!
ASKER
WTH's MouseDown for then anyway....