Skip to main content
Known Participant
September 4, 2009
Answered

Disable buttons in a movie clip

  • September 4, 2009
  • 1 reply
  • 1137 views

Hi!

I have a screen with transparency that pops up over a movieclip full of buttons.

I need to disable the movie clip and/or buttons so they don't function when the pop up comes up.

Can't get it to work with this code:

myMC._enabled=false;

or

myMC.myBTN._enabled=false;

with both of those code pieces, the buttons still function??

Any ideas???

This topic has been closed for replies.
Correct answer Ned Murphy

Maybe your instance names aren't assigned properly--if your buttons transition in at all, then you need to be sure to name them at all keyframes.

Maybe what you should do is create a function for enabling/disabling the button(s) ... put it inside the movieclip for startes.  That way you can call the function and confirm that you are at least targeting the function correctly by including a trace in it.

In any case, "enabled" without the underscore is the correct way to code it.

1 reply

Ned Murphy
Legend
September 4, 2009

Try using "enabled" without the underscore, and use it for each button in the mc separately.

Known Participant
September 4, 2009

Yes, I tried that too.

_root.myMC.myBTN.enabled=false;

But the button still functions?

If I target the button like I am, I should be able to place that code anywhere, correct?

I have the code on the screen where the pop up comes up.

Ned Murphy
Ned MurphyCorrect answer
Legend
September 4, 2009

Maybe your instance names aren't assigned properly--if your buttons transition in at all, then you need to be sure to name them at all keyframes.

Maybe what you should do is create a function for enabling/disabling the button(s) ... put it inside the movieclip for startes.  That way you can call the function and confirm that you are at least targeting the function correctly by including a trace in it.

In any case, "enabled" without the underscore is the correct way to code it.