Submenu mouse clicks not registering

I really don't know half of what I'm doing when it comes to Action Script 3. Through a lot of trial and error, I finally have my menu with submenus displaying properly, but just not functioning the way that I have intended. The submenu items appear when a mouse over registers on the mainmenu item. The submenu mouse rollovers are registering correctly because the right content is displayed and the alpha channel changes are registering. The problem is with the mouse clicks for the submenu items. I don't understand why but a mouse click on a submenu button is registering as a click on the mainmenu item, not the submenu item. Could someone please explain to me why the rollover function is working and not the mouse click, and what I need to do to fix my code? I hate to admit it, but I am really clueless here.
Here is my website:  www.deyonjonson.com
And here is the relevant part of my code:
SWFAddress.addEventListener(SWFAddressEvent.CHANGE, SWFAddress_changed);
menu1.alpha = 0.5;
menu1.buttonMode = true;
menu1.useHandCursor = true;
menu1.menu1A.visible = false;
menu1.menu1B.visible = false;
menu1.menu1C.visible = false;
menu1.addEventListener(MouseEvent.ROLL_OVER,onOver1);
menu1.addEventListener(MouseEvent.ROLL_OUT,onOut1);
menu1.addEventListener(MouseEvent.CLICK,onClick1);
menu1.menu1A.addEventListener(MouseEvent.ROLL_OVER,onOver1A);
menu1.menu1A.addEventListener(MouseEvent.ROLL_OUT,onOut1A);
menu1.menu1A.addEventListener(MouseEvent.CLICK,onClick1A);
menu1.menu1B.addEventListener(MouseEvent.ROLL_OVER,onOver1B);
menu1.menu1B.addEventListener(MouseEvent.ROLL_OUT,onOut1B);
menu1.menu1B.addEventListener(MouseEvent.CLICK,onClick1B);
menu1.menu1C.addEventListener(MouseEvent.ROLL_OVER,onOver1C);
menu1.menu1C.addEventListener(MouseEvent.ROLL_OUT,onOut1C);
menu1.menu1C.addEventListener(MouseEvent.CLICK,onClick1C);
function SWFAddress_changed(e:SWFAddressEvent) {
switch (e.value) {
case "/index":
gotoAndStop("main");
break;
case "/cycling/amgen2010/":
gotoAndStop("cycling_amgen2010");
break;
case "/cycling/amgen2009/":
gotoAndStop("cycling_amgen2009");
break;
case "/cycling/amgen2008/":
gotoAndStop("cycling_amgen2008");
break;
function onOver1(e:MouseEvent):void {
my_ssp.loadContent(0);
SWFAddress.setStatus("index");
menu1.alpha = 1;
menu1.menu1A.alpha = 0.5;
menu1.menu1B.alpha = 0.5;
menu1.menu1C.alpha = 0.5;
menu1.menu1A.visible = true;
menu1.menu1B.visible = true;
menu1.menu1C.visible = true;
function onOut1(e:MouseEvent):void {
SWFAddress.resetStatus();
menu1.alpha = 0.5;
menu1.menu1A.visible = false;
menu1.menu1B.visible = false;
menu1.menu1C.visible = false;
function onClick1(e:MouseEvent):void {
SWFAddress.setValue("index");
// menu1A
function onOver1A(e:MouseEvent):void {
my_ssp.loadContent(1);
SWFAddress.setStatus("cycling/amgen2010/");
menu1.alpha = 1;
menu1.menu1A.alpha = 1.0;
menu1.menu1B.alpha = 0.5;
menu1.menu1C.alpha = 0.5;
function onOut1A(e:MouseEvent):void {
SWFAddress.resetStatus();
menu1.alpha = .5;
menu1.menu1A.alpha = 0;
menu1.menu1B.alpha = 0;
menu1.menu1C.alpha = 0;
function onClick1A(e:MouseEvent):void {
SWFAddress.setValue("cycling/amgen2010/");
// menu1B
function onOver1B(e:MouseEvent):void {
my_ssp.loadContent(2);
SWFAddress.setStatus("cycling/amgen2009/");
menu1.alpha = 1;
menu1.menu1A.alpha = 0.5;
menu1.menu1B.alpha = 1;
menu1.menu1C.alpha = 0.5;
function onOut1B(e:MouseEvent):void {
SWFAddress.resetStatus();
menu1.alpha = .5;
menu1.menu1A.alpha = 0;
menu1.menu1B.alpha = 0;
menu1.menu1C.alpha = 0;
function onClick1B(e:MouseEvent):void {
SWFAddress.setValue("cycling/amgen2009/");
//menu1C
function onOver1C(e:MouseEvent):void {
my_ssp.loadContent(3);
SWFAddress.setStatus("cycling/amgen2008/");
menu1.alpha = 1;
menu1.menu1A.alpha = 0.5;
menu1.menu1B.alpha = 0.5;
menu1.menu1C.alpha = 1;
function onOut1C(e:MouseEvent):void {
SWFAddress.resetStatus();
menu1.alpha = .5;
menu1.menu1A.alpha = 0;
menu1.menu1B.alpha = 0;
menu1.menu1C.alpha = 0;
function onClick1C(e:MouseEvent):void {
SWFAddress.setValue("cycling/amgen2008/");
Any guidance on how to clear this up would be greatly appreciated.
Thank you!

This is kind of a dirty rotten problem.  Your submenus are inside the main menu right?  So when you click on a submenu item (i.e. menu1A), you are also clicking on the main menu (menu1).  Technically both click events fire (menu1a is first, menu1 is second). A better way to think about it is:  If you are doing construction on your bathroom you are doing construction on your house since the bathroom is in your house.  Confusing, right?
To fix this, you want to "cancel" the click event for menu1 if you click on one of the sub menu items. Add this line into each of your sub menu functions:
e.stopImmediatePropagation();
So one of your functions would look like this:
function onClick1A(e:MouseEvent):void {
e.stopImmediatePropagation();
SWFAddress.setValue("cycling/amgen2010/");

Similar Messages

  • MBA Mouse clicks not registering?

    I've got a weird one with my son's MBA (2008), running Mountain Lion. It's not recognizing mouse clicks from either trackpad or external Magic Mouse. This is happening from boot- normal boot, safe boot and booting into tools menu.
    He was playing minecraft when it went out and nothing I've tried since has got it back- basically lots of reboots and reseting NVRAM and SMC.
    I don't have a wired USB mouse to test that with at home, and I don't have an external USB drive with enough space to create a mountain lion rescue disk at them moment- at least not one I'm milling to mess with (backup drives). I'll pick up an 8GB thumb drive later and give that a try however.
    Any thoughts appreciated- likely a trip to the genius bar, but that's best avoided- closest one is an hour away.

    This is kind of a dirty rotten problem.  Your submenus are inside the main menu right?  So when you click on a submenu item (i.e. menu1A), you are also clicking on the main menu (menu1).  Technically both click events fire (menu1a is first, menu1 is second). A better way to think about it is:  If you are doing construction on your bathroom you are doing construction on your house since the bathroom is in your house.  Confusing, right?
    To fix this, you want to "cancel" the click event for menu1 if you click on one of the sub menu items. Add this line into each of your sub menu functions:
    e.stopImmediatePropagation();
    So one of your functions would look like this:
    function onClick1A(e:MouseEvent):void {
    e.stopImmediatePropagation();
    SWFAddress.setValue("cycling/amgen2010/");

  • USB Mouse clicks get registered twice, sometimes

    Hello all
    I am using Arch Linux on my Thinkpad T61, and I usually have a USB mouse hooked up to it (Logitech Nano).
    A while ago I started to do some tweaks in order to enable the Synaptics TouchPad and get proper scrolling behaviour on the TrackPoint. However, I must have done something, because ever since, many of my USB mouse clicks get registered as a double click (not always, but often).
    I started doing some troubleshooting today, by commenting out parts of my xorg.conf file (I use evdev hotplugging, but I tought maybe Xorg was registering my mouse aswell) and I even booted up without an xorg.conf once, to no avail. The problem definately does not lie there.
    The only policy file I have that has anything to do with a mouse is /etc/hal/fdi/policy/mouse-wheel.fdi.
    [rob@rob-thinkpad ~]$ cat /etc/hal/fdi/policy/mouse-wheel.fdi
    <match key="info.product" string="TPPS/2 IBM TrackPoint">
    <merge key="input.x11_options.EmulateWheel" type="string">true</merge>
    <merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
    <merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
    <merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
    <merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
    <merge key="input.x11_options.EmulateWheelTimeout" type="string">200</merge>
    </match>
    Also, I found multiple entries for my mouse in /proc/bus/input/devices:
    [rob@rob-thinkpad ~]$ egrep "Name|Handlers" /proc/bus/input/devices
    N: Name="Macintosh mouse button emulation"
    H: Handlers=mouse0 event0
    N: Name="AT Translated Set 2 keyboard"
    H: Handlers=kbd event1
    N: Name="ThinkPad Extra Buttons"
    H: Handlers=kbd event2
    N: Name="Power Button (FF)"
    H: Handlers=kbd event3
    N: Name="Lid Switch"
    H: Handlers=event4
    N: Name="Sleep Button (CM)"
    H: Handlers=kbd event5
    N: Name="Video Bus"
    H: Handlers=kbd event6
    N: Name="PC Speaker"
    H: Handlers=kbd event7
    N: Name="SynPS/2 Synaptics TouchPad"
    H: Handlers=mouse1 event8
    N: Name="Logitech USB Receiver"
    H: Handlers=mouse2 event9
    N: Name="Logitech USB Receiver"
    H: Handlers=kbd event10
    N: Name="TPPS/2 IBM TrackPoint"
    H: Handlers=mouse3 event11
    N: Name="ThinkPad HDAPS joystick emulation"
    H: Handlers=event12 js0
    N: Name="ThinkPad HDAPS accelerometer data"
    H: Handlers=event13 js1
    Could someone please help me solve this problem, for I have no more ideas how to go at this... Thanks
    Last edited by robrene (2009-06-05 09:47:18)

    It seems there are multiple entries for my USB mouse in /var/log/Xorg.0.log!
    (II) config/hal: Adding input device Logitech USB Receiver
    (**) Logitech USB Receiver: always reports core events
    (**) Logitech USB Receiver: Device: "/dev/input/event9"
    (II) Logitech USB Receiver: Found 16 mouse buttons
    (II) Logitech USB Receiver: Found x and y relative axes
    (II) Logitech USB Receiver: Found scroll wheel(s)
    (II) Logitech USB Receiver: Configuring as mouse
    (**) Logitech USB Receiver: YAxisMapping: buttons 4 and 5
    (**) Logitech USB Receiver: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
    (II) XINPUT: Adding extended input device "Logitech USB Receiver" (type: MOUSE)
    (**) Logitech USB Receiver: (accel) keeping acceleration scheme 1
    (**) Logitech USB Receiver: (accel) filter chain progression: 2.00
    (**) Logitech USB Receiver: (accel) filter stage 0: 20.00 ms
    (**) Logitech USB Receiver: (accel) set acceleration profile 0
    (II) config/hal: Adding input device Logitech USB Receiver
    (**) Logitech USB Receiver: always reports core events
    (**) Logitech USB Receiver: Device: "/dev/input/event10"
    (II) Logitech USB Receiver: Found 1 mouse buttons
    (II) Logitech USB Receiver: Found scroll wheel(s)
    (II) Logitech USB Receiver: Found keys
    (II) Logitech USB Receiver: Configuring as keyboard
    (II) Logitech USB Receiver: Adding scrollwheel support
    (**) Logitech USB Receiver: YAxisMapping: buttons 4 and 5
    (**) Logitech USB Receiver: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
    (II) XINPUT: Adding extended input device "Logitech USB Receiver" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "de"
    (**) Option "xkb_options" "terminate:ctrl_alt_bksp"
    This looks pretty bad to me... The USB reciever is listed once as a mouse and once as a keyboard. Something went very awry here. This is the output after a fresh boot without xf86-input-mouse installed. The only remaining input drivers I have left from xf86 are:
    [rob@rob-thinkpad ~]$ pacman -Q xf86-input-
    xf86-input-evdev xf86-input-keyboard xf86-input-synaptics
    edit
    I removed xf86-input-keyboard as well now, still no change...
    edit2
    Aha! After some Googling and hooking up the mouse on a Windows XP machine, I noticed that this is a problem with this specific mouse. Under Windows XP, I get the same behaviour (often a double click, sometimes no click at all). It seems it is time to find the warranty papers for this baby. In case anyone ever reads this, this happened to me on a Logitech VX Nano, after about 5-10months of usage (I don't recall when I bought it exactly).
    Last edited by robrene (2009-06-05 15:14:23)

  • Mouse clicks not recognized?

    I have a 20" iMac w/ the most recent updates. In the past couple of days I have a problem with mouse clicks not being recognized. It seems to happen when I begin to fill in a text field either in Safari or the Finder (like trying to enter username/password, to authenticate in the finder, etc) The wierd thing is that this only happens on one of the two user accounts on this computer. I have also created a new user account and it is fine. I've looked for applications that are different, but can't find any. I have repaired permissions and repaired the disk through disk utility.
    I am at the end of my rope! Please help!

    I somehow managed to fix it, for now. I think I ended up resetting the PRAM. I gave up trying software solutions and unplugged everything, including the iMac's power cable, and cleaned up the mess of cables behind my desk because I needed some time to think. After starting up the computer, everything seems to be fine. If the problem comes back, I'll post here again. Thanks for the suggestion!

  • Magic Mouse click not working

    I have a magic mouse, with a MBP and 10.6.1 and the wireless mouse update installed.
    The mouse more or less works if "Secondary click" is checked. If I uncheck it, clicking does nothing. The mouse moves and scrolling works, but clicking has no effect.
    Also with "Secondary click" checked, if any part of my hand is touching the top surface of the mouse, I get a right-click when I click - makes the grip kind of awkward.
    Tried re-installing the software update.
    Any ideas? Thx.

    Not sure why it worked this time, but I deleted
    com.apple.driver.AppleBluetoothMultitouch.mouse.plist
    from the User preference folder again, and now the mouse is behaving as normal. I did not touch the .globalpreferences file.
    I did clean all the system/user caches (using Cache Out X), and then deleted this file again, but now the behavior seems correct
    - with Secondary Click deslected, the surface acts as one big single click button
    - with Secondary Click selected, it acts as a two button mouse
    - in Secondary Click mode, resting your second finger on the contexual side surface while clicking on the single click side surface does not interfere with the single click as it had before
    - in Secondary click mode, you need to lift your finger off the single click side when clicking the contextual button side, or it will not register as a contexual click. I presume this is expected behavior, as it is physically a one-button mouse, and Apple opted for a two-finger click to be interpreted as the more common single click request.
    Hope this helps some

  • Mouse click not working properly

    I just bought a macbook pro last week. Since using lion, I have noticed a problem clicking. Such as opening folders, minimizing windows, clicking the back space button etc. I click on a few folders and they open, and then I try to click on another one and it refuses to open no matter how many times I click on it unless I unselect it and try again. It is not consistent to specific folders/icons, it just happens at random. It is as if the OS is not registering clicks consistently, like it were a hardware problem. Also my right click malfunctions at times and will either not work or will behave like it is the left click and vice versa and takes awhile to regulate itself.
    Keep in mind I use both a wireless usb mouse and my trackpad and this is a problem I experience with both of them. I am using the latest version (10.7.3)

    Your warranty includes 90 days of phone support. Call AppleCare.

  • Mouse clicks not detected on JTabbedPane

    Hi all,
    I have a JPanel placed inside a JTabbedPane. I want to double-click on the JPanel and bring up a JDialog. This works fine if the JPanel is not in a JTabbedPane, but if it is on a JTabbedPane, then the mouse clicks are not detected. I'd greatly appreciate any help you can give me.

    Here is a sample program that seems to work:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    public class TestInternalFrame extends JFrame
         public TestInternalFrame()
              JDesktopPane desktop = new JDesktopPane();
              setContentPane( desktop );
              JInternalFrame internal = new JInternalFrame( "Internal Frame" );
              desktop.add( internal );
              internal.setLocation( 50, 50 );
              internal.setSize( 300, 300 );
              internal.setVisible( true );
              JTabbedPane tabbedPane = new JTabbedPane();
              internal.getContentPane().add(tabbedPane);
              tabbedPane.setPreferredSize( new Dimension(300, 200) );
              JPanel panel = new JPanel();
              tabbedPane.add( "Empty Panel", panel );
              panel.addMouseListener( new MouseAdapter()
                   public void mouseClicked(MouseEvent e)
                        System.out.println(e.getClickCount());
         public static void main(String args[])
    TestInternalFrame frame = new TestInternalFrame();
    frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
    frame.setSize(400, 400);
    frame.setVisible(true);

  • Mouse click not working

    i set up a new battery, i pressed command D without not cause. After that my mouse is not working, its noly moving and scroll. Does not CLick.what to do now?

    Please reset the SMC Control, Apple explains how in:
    http://support.apple.com/kb/ht3964

  • Mouse click not always recognized

    Adobe is slow to recognize my mouse clicks when selecting items. For example I will have selected 1.jpg, then get ready to work on 2.jpg, but I will have to click three to four times before 2.jpg will show in my properties window. Although I can see it is selected in the main window, any work I will do gets applied to 1.jpg. I do not have this issue with any other adobe products.

    How big are your images?
    Are you working with valid code?
    http://validator.w3.org/
    (='.'=)
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • Mouse Clicker Not Working

    Hey
    You know how the mouse clicker is supposed to pop back up after you click it? Well only one side of my clicker does. The other side will not pop back up. I believe my laptop is still under warranty. If I take it into the Apple store can they fix it?
    Thanks

    If you are under warranty, just take it back and Apple should fix it.
    If you are out of warranty, I'm sorry no answer for that.

  • Webi: Mouse clicks not working

    Hi
    I am using BO XI 3.1, Webi 12. .1.0.882 client. It is not responding to mouse clicks although I can use keyboards to open the universe e.g.(even for logon).
    Any ideas why is this happening and how to sort this?
    Thanks for all help.

    I have the same problem some times.
    This is going to sound crazy, but try this:
    1. Lay the mouse down like you would if you were going to use it.
    2. Use you index finger and "bang" on the mouse like you were mad at it. Hit it where the primary button (left side for me) is. Don't be too aggressive.
    3. It should work. It has always worked for me.
    4. It also helps to clean the track ball. I just run the track ball back and forth on my jeans.
    Good luck!
    P.S. I do not think this will void any warranty, just don't tell Apple!

  • Mouse clicks not working

    Hello,
    I am managing a mac pro (leopard) from a macbook (leopard) using remote desktop 3.2. Often when I control the mac pro, and enter a user session the mouse clicks on the managed computer behave incorrectly. A normal click corresponds to a click with a side button (the ones that show all the windows on screen). When this happens I have no other solution than to reboot the managed machine because I can't control it with the mouse. (can't select anything)
    Has this happened to anyone else ?

    Oops. Doing the same thing again. If I disconnect/reconnect the mouse, the buttons get switched to the right position. After that log out/in and the buttons are again the other way around. To do a click have to press the command key while pressing the mouse button.

  • Mouse clicks not working on published air app, works fine when debugging/testing

    So I have an issue where when debugging my Air application, it runs fine and mouse clicks work and everything.  When I publish the application and install it, it plays fine but clicking does nothing.
    We have an older version which is working when we publish it and we're trying to add things in one step at a time, but I figured I'd see if anyone else has had this issue.  A bit frustrating.
    Thanks!

    FIXED!!!!
    We're using Dropbox to share files and it turns out that two people having project open at same time is a bad idea when doing final publish!  It creates conflict files and effects the final package or something of that nature.
    Glad we got that one figured out!

  • Mouse button not register all clicks

    I have a problem with my mouse, sometimes when I click, it doesn't click. This usually happens in the dock, when I open up 2 programs, I have to click out of the dock before I can open another program, otherwise it won't recognize the click. Has this happened to anyone else?

    Yes! I just started having the same problem. The same thing happens in other places too - I have to click out of a program or window then click back in so it will register. Also, sometimes it seems to think I'm double-clicking when I'm not. At first I thought it was my mouse so I plugged in another one but it still happens. I haven't changed any of the mouse settings. I hope someone out there can help us, it can get pretty annoying and slow down a lot of tasks.

  • HT4848 Two days ago I upgraded my MAC PRO from Lion to Mountain Lion via my account at the Apple App store.  My machine runs so slow with Mountain Lion especially mail that it is completely useless.  It take about ten minutes per mouse click to register. 

    I also run Parralles 7.  I re-installed this a few times with no affect.  I have it not running and my Mountain Lion is still too slow to use.  Again a single mouse or keystroke takes up to ten minues to register. 
    Suggestions ?

    Startup in Safe mode (holding Shift key down) http://support.apple.com/kb/HT1455
    Then you can update or uninstall your problematic third-party software.

Maybe you are looking for