Skip to main content
Inspiring
April 25, 2008
Question

Blocking a:hover tags

  • April 25, 2008
  • 4 replies
  • 403 views
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?
This topic has been closed for replies.

4 replies

kglad
Community Expert
Community Expert
April 26, 2008
you can probably use the prototype.addProperty to add and remove a stylesheet from all your textfields in your rollover and rollout handlers.
RothrockAuthor
Inspiring
April 25, 2008
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! :)
April 25, 2008
I realize this is kind of what you did already, but doesn't that achieve what you're after?

Cheers,
FlashTastic
kglad
Community Expert
Community Expert
April 25, 2008
disable the selectable property of your textfield.
RothrockAuthor
Inspiring
April 25, 2008
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!)