Skip to main content
Inspiring
March 13, 2009
Answered

Can you disable hitArea once it's set?

  • March 13, 2009
  • 1 reply
  • 511 views
If I create a Movie Clip and assign a child Movie Clip as the hit area using this.hitArea = this.mcClipName; is there a way for me to disable that hit area?

For instance, mcButton is a button. When I click mcButton, it triggers a function that reveals other content in my movie. I don't want them to be able to click that button again unless they close the new content (using another button that appears with the new content).

Is there a way for me to disable the hit area of mcButton?
This topic has been closed for replies.
Correct answer 0degreesK
Thanks. Something tells me this is ActionScript 101 and I should've known this.

1 reply

Ned Murphy
Legend
March 13, 2009
In mcButton's onRelease function you can simply use:

mcButton.enabled = false;

And then have the other button set it back to true.
0degreesKAuthorCorrect answer
Inspiring
March 13, 2009
Thanks. Something tells me this is ActionScript 101 and I should've known this.
Ned Murphy
Legend
March 13, 2009
Actually, AS101 should be a course where people learn that there are basically three elements to objects... properties, methods, and events. And the Flash help documents identify all of them. So anytime you have a wondering about some object, the first thing you should do is see what it has to support the desired result. I do it all the time, and I've been at this for about 9 years now.