Spent half the night fighting that issue, I wanted to disable mouse clicks for TextFields on my gui HUD panel. So that I could click units beneath those text fields.
tf.mouseEnabled = false;//didnt work for me as well as
tf_parent.mouseEnabled = false;//and
tf_parent.mouseChildren = false;
the problem was that the panel sprite (parent of text fields) was intercepting mouse clicks..
The receipt:
– use this code to monitor who’s receiving the click
import flash.utils.getQualifiedClassName;
stage.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void
{
trace(“clicktarget: “, event.target.name, getQualifiedClassName(event.target));
}
– and
tf.mouseEnabled = false;
tf_parent.mouseEnabled = false;//and remove the hitArea for parent!!!!
tf_parent.hitArea = new Sprite();
tf_parent.hitArea.mouseEnabled = false;
Hope this helps somebody!
I LOVE YOU! I have been searching for forever, but I finally found this…Extremely helpful.
Thanks very much!
Dude, you made my day! <3 you. I saved a lot of time, thx for you. Gl.
Thanks man, saved me a bunch of time. It’s always the little things like this that always take so long to debug.
Thanks! I been struggling with this issue for years! Always had to work around it with some crazy solutions