MC covering buttons...on purpose...?
I have a whole crapload of buttons on the screen and I want an mc to pop up over them and cover them so the button states don't work. What I DON'T want is for the mc to be a big button...it will make the navigation a little confusing.
Usually people seem to be trying to solve this problem rather than create it on purpose. ;)
I could add:
buttonName._enabled = false;
for each button but there's 135 of them...so if I could avoid it, that would be great.
Suggestions?
Use a function along with Copy & Paste
You might want to try to create a function on the Main Timeline like so:
Code:
function disableBtns() {
buttonName._enabled = false;
otherButtonName._enabled = false;
anotherButtonName._enabled = false;
...etc...;
}
Of course you can highlight & Copy "._enabled = false;" and paste it quickly after each of the 135 buttons.
Then highlight and Copy the entire function, paste it below the original, and then rename disableBtns() to enableBtns().
Code:
function disableBtns() {
buttonName._enabled = false;
otherButtonName._enabled = false;
anotherButtonName._enabled = false;
...etc...;
};
function enableBtns() {
buttonName._enabled = false;
otherButtonName._enabled = false;
anotherButtonName._enabled = false;
...etc...;
};
In this new function, single-click before the very first "false" in the code. Hit CTRL+"H" (Windows) or COMMAND +"H" (Mac) to initiate a Find/Replace. Under "Find what:" type "false". Under "Replace with:" type "true". DO NOT DO A REPLACE ALL but rather a bunch of "Replace" clicks. Stop at the last one in this function.
Code:
function disableBtns() {
buttonName._enabled = false;
otherButtonName._enabled = false;
anotherButtonName._enabled = false;
...etc...;
};
function enableBtns() {
buttonName._enabled = true;
otherButtonName._enabled = true;
anotherButtonName._enabled = true;
...etc...;
};
From this point on, whenever you need ALL of the buttons disabled, call the _root.disableBtns() function. Whenever you need ALL of the buttons enabled again, call the _root.enableBtns() function.
It's a little work but, 135 really isn't that bad, especially when you only have to really type (or target) each one out only once.
Hope that helps!
Kirk =]