5 Replies Latest reply on Apr 25, 2008 5:22 PM by kglad

    Blocking a:hover tags

    Rothrock Level 5
      I've got some text "menus" made up of css styled html enabled text fields. They work fine. Sometimes there is a semi transparent MovieClip that floats above them that has some onRollOver, onRelease, etc. events defined.

      I've noticed that the semi-transparent button stops the propagation of most mouse events to anything below it. But the a:hover and a:active states of the text fields still reacts to the mouse being over/clicking the text. The actual link doesn't work or call the asfunction.

      So does anybody know an easy way to block that from happening?
        • 1. Re: Blocking a:hover tags
          kglad Adobe Community Professional & MVP
          disable the selectable property of your textfield.
          • 2. Re: Blocking a:hover tags
            Rothrock Level 5
            Thanks kglad. That isn't working for me. Here is my simple test case. I have a dynamic text field on the stage with an instance name of theField. And a partially transparent movieclip called cloak which overlaps the text field. (These could all be done dynamically and my actual project has a lot more going on.)

            I tried changing the selectable property, but that didn't make a difference. I was able to set the styleSheet property of the textfield to null and then to reassign myStyle later and that worked, but I'm hoping to find a totally simple way to just block all mouse events from getting below the cloak. (I know old-school modal dialog. An oldie, but a goody!)
            • 3. Re: Blocking a:hover tags
              FlashTastic Level 1
              I realize this is kind of what you did already, but doesn't that achieve what you're after?

              • 4. Re: Blocking a:hover tags
                Rothrock Level 5
                Yes. That does the trick, but I was hoping to not have to keep track of every text field (there are many and they are variable). I'm sure that (or similar) is the approach that I will have to take in the end. I was just hoping for a trick! :)
                • 5. Re: Blocking a:hover tags
                  kglad Adobe Community Professional & MVP
                  you can probably use the prototype.addProperty to add and remove a stylesheet from all your textfields in your rollover and rollout handlers.