|
-
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 =]
100 posts until an avatar...
-
That would work, but that's what I was trying to avoid...but good suggestion anyway, if I wasn't so lazy I probably would have done that. 
However, sometimes laziness is the mother of invention:
My solution, which works well and is remarkably simple, was to create a button that is invisible and does nothing. Then I just added code to it so it doesn't use the hand cursor when I roll over it. Buttons that are under it don't work at all and buttons that are over it work normally. To the user though, it seems like there's nothing there.
It's amazing what a little research combined with an all-encompassing desire to avoid tedious work will do for you sometimes.
Maybe that will help some other people down the line.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|