4 Replies Latest reply on Aug 20, 2007 4:23 AM by pavel128

    Why mouse press is not detected?

    pavel128
      Hi!
      Under simple conditions mouse-clicks are not detected by Flash.
      Do you know why?

      Consider a simple test program: http://www.actionscript.org/forums/attachment.php3?attachmentid=23649&d=1186992136
      There are 2 objects on the Stage:
      - a ComboBox (Component 2.0)
      - a simple MovieClip - a circle that changes its color when you click it.

      Ok, now do the following:
      -click the ComboBox to display its contents
      -click on the Stage to close the ComboBox
      -move the mouse over the Circle
      -click mouse-button, the Circle changes its color
      -now DONT'T MOVE the mouse
      -click mouse-button again, the Circle color is not changed (that means the click was not detected!)
      -now move the mouse a bit and click again - the Circle color was changed successfully.

      So the bug repeats under the following conditions:
      -a ComboBox was open (or any other Popup component, a Menu, for example)
      -the user clicked the mouse over the MovieClip for the second time at the same location

      I compile under Flash 8.

      Pasha
        • 1. Re: Why mouse press is not detected?
          kglad Adobe Community Professional & MVP
          it's well-known component issue. the only work-around i know is to not use those components that cause the problem. there may be others that i don't know about because i rarely use components and generally discourage their use.
          • 2. Re: Why mouse press is not detected?
            pavel128 Level 1
            Thanks, kglad!

            Unfortunately my app is very dependant on Components (main-menu, options dialog, etc).
            Either I leave this bug in production or have to patch it.
            I'll take a look at Component 2.0 sources and will try to find the cause.
            Maybe there's a workaround, who knows...
            • 3. Why mouse press is not detected?
              klintonray Level 1
              I don't know how to fix your problem, but just wanted to say that I wholeheartedly agree with kglad.

              I am working on a project now that needs to have a custom scroll bar that I can incorporate with dynamic text fields that need to be scrolled.

              Four days ago, I decided to save some time and just use and modify the UIScrollBar Component.

              ALL SORTS OF LITTLE BUGS EVERYWERE.

              After messing with it for an entire weekend, I decided to just bite the bullet and write my own scrollbar class.

              Here is what happened for me when I decided to write my own class.

              own class --------------------vs------------------- component
              ___________________________________________________
              took 4 hours ------------------------- took 3 days until quit

              3 mc's in the library to modify if you want ------------------------ I don't even want to count the
              to change the look --------------------------- amout of mcs u gotta change

              can change width of scrollbar on the fly ------------------- can't change width of a vertical sb


              added an autoscroll function that starts ------------------------------ no such function
              scrolling down slowly upon page load ----------------------------------

              increase file size by a few kilobytes --------------------- increase filesize by like 30kb

              NO BUGS -------------------- BUGS EVERYWERE.


              Lesson I had to learn: Components waste more time than I did on my World of Warcraft phase.

              They are good for designers who have limited scripting knowledge, just be aware that they can be very buggy. There are lots of third party developers that sell menu components and the like. You may want to look in that direction if you absolutely must use components and the included ones aren't working for you.
              • 4. Re: Why mouse press is not detected?
                pavel128 Level 1
                Thanks, kintonray!
                In case the scrollbar was the only UI contol that I needed, I would implement it by myself.
                But I need almost any kind of standart controls, for options-dialog for example.
                It would took me ages to implement such a set of controls.
                So the Components 2.0 seemed a good choice for me when I was starting the project.
                Of course, now it is obvious, there are a lot of bugs, but there are a great bunch of functionality.
                Now I have already done a substantial part of the program using Components 2.0, so it would take a lot of time to migrate to another UI-controls library. And I don't want to loose the time.
                So I I'm gonna patch a couple of bugs and go on. :)