Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Flash MouseDown event not working as expected....

Posted on 2007-07-25
6
Medium Priority
?
1,433 Views
Last Modified: 2008-01-09
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();
      };
}
0
Comment
Question by:unluckynelson
  • 3
  • 3
6 Comments
 
LVL 22

Accepted Solution

by:
rascalpants earned 2000 total points
ID: 19566204
don't use onMouseDown...

use onRelease


rp
0
 
LVL 1

Author Comment

by:unluckynelson
ID: 19566252
Aaah, thanx, you're a genius...
WTH's MouseDown for then anyway....
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 19566271
also, you may want to change your gotoAndPlay(3)  to gotoAndStop(3)

see if that makes a difference


rp
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:unluckynelson
ID: 19566318
Thanks, I will...
Do you also maybe know why onRollOut doesn't always execute? leaving my buttons on a rollover state...
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 19566390
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
 
LVL 1

Author Comment

by:unluckynelson
ID: 19566437
Aaah, yes, you're right... It was that...
Thanks a million!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question