Groups | Blog | Home
all groups > flash (macromedia) > september 2007 >

flash (macromedia) : Hide the hit area of a TextField


Thomas Unger
9/3/2007 3:54:41 PM
In8Media;
Not sure I follow your description, but given the mention of a
difference with previous versions (there really has not been much change to
button symbols or "placed" text fields)-perhaps you have inadvertently made
the text field selectable via the properties panel? If so, does making it
not selectable solve the problem? -Tom Unger -Tom Unger

Thomas Unger
9/3/2007 6:56:12 PM
In8Media;
Oh well, it was worth a try... Unfortunately I don't have flash cs3
installed here at home to do any testing today, but hopefully someone else
will chime in. -Tom Unger

In8Media
9/3/2007 7:22:13 PM
In previous versions of Flash I could put a dynamic TextField over a button
without the hit area of the TextField interfering with the hit area of the
button. In Flash 9, it behaves as if the TextField is another button. Is there
any way to turn off the visibility of the hit area for the TextField, so the
dynamic TextField behaves as if it is inside the button (without my having to
put it there)?

In WPF this is a property called "isHitTestVisible". I believe the Flash
concept of hitTest is unrelated to how the built in Flash button behaves, but
there has to be some way to control this. Does anyone know a way to disable the
dynamic TextField from interfering with the Button when it is on top of it?

Thanks.

Nathan
In8Media
9/3/2007 9:43:18 PM
Hi, Thomas. Thanks for the reply.

No, I have disabled the "selectable" option. With a selectable field I would
expect it to behave this way. That's the really puzzling thing. Go ahead and
give it a try -- you can reproduce this in seconds. Create a button, and put a
dynamic field on it. You'll see that you get a pointer hand cursor for the area
of the button that isn't under the text, and the arrow cursor when you are over
the text. With selectable enabled, you will get the text input cursor (as
expected).

Just to make sure I'm sane, and that it hasn't always worked this way -- I
went back and tried this on Flash 8, and of course it behaves as I had expected
it to in Flash 9.

Its fine for it to behave this way, but there should at least be a property
that I can call from Actionscript to change this behavior. In fact, what would
be preferable would be if I could set it to one of three options: exclusive
(the textfield covers up the button, as it does now), invisible (the textfield
does not cover it, which is what I want I am trying to do), and additive
(meaning that BOTH the textfield AND the button receive input from the mouse).
Also, this property should exist on all display objects, not just TextFields
and Buttons.

WPF has this in the form of the "isHitTestVisible" property on their
UIElements, except that it only has 2 states: true (exclusive) and false
(invisible). If Adobe added a property to Flash, calling it something like
"isHitAvailable" or "receivesInput" with the additional state of "additive",
this would put the Flash platform at an advantage over Microsoft's platform for
designers/developers like myself.
In8Media
9/4/2007 10:54:10 PM
I found the solution:
myText.mouseEnabled = false;

I didn't realize there were more methods inherited from the parent classes.
The one I wanted was on the InteractiveObject class.

It would still be nice if I could have non-exclusive mouse input, though.
AddThis Social Bookmark Button