Skip to main content
Inspiring
July 10, 2008
Question

disable button

  • July 10, 2008
  • 24 replies
  • 1718 views
as my previous post Loading external movie on top of all layers

i am facing a problem now that all the buttons are still working when the external movie loads on top.
I want all the menu buttons to be disabled when the external movie loads and there is a CLOSE Button in the external movie. i tried to search for how to disable the buttons. i found some, but couldnt understand what to do.

So any help will be appreciated here plz.

Thnx in advance.

Regards
This topic has been closed for replies.

24 replies

Venian
Inspiring
July 16, 2008
Better view the fla file. That idea is that from the code you showed us i understand that you put the actions on a button not on a frame.
You say you used:

on (release) {
} - this is used only when you click on the button in the stage and press F9 to add code directly to it. It isn't a good practice. Here for example you probably don't target right the movieclips if you set the actions in the button
you target a that second button as if it were inside the button that contains te code.

You should select a frame, from any layer (best the top layer), from inside the movieclip that contains all the buttons and press F9 to right the code there. Exemple:

security.onRelease = function {
// this.swapDepths(1);
_root.createEmptyMovieClip("target_mc1",_root.getNextHighestDepth());
_root.target_mc1._x = -600;
_root.target_mc1._y = -150;
_root.target_mc1.loadMovie("1.swf");
security.enabled=false;
development.enabled=false;
}
Angel3mAuthor
Inspiring
July 15, 2008
Thnx kGlad

well, i have got the solution
i was putting the code in the main menu file.
but had to add in an external file. and here is the code

my_invisible_btn.useHandCursor = false;

thats all

Thnx everyone

Regards
kglad
Community Expert
Community Expert
July 14, 2008
if you want to hire me to solve your problem send me an email via my website.
Angel3mAuthor
Inspiring
July 14, 2008
here i ve uploaded the file. Plz download it:

http://www.adhabi.com/docs/menu.zip

Thank you
kglad
Community Expert
Community Expert
July 14, 2008
i don't think i can help you without looking at your fla and doing the work for you. the things you're saying i have trouble understanding and you're not making progress understanding basic flash terminology as i explain it.
Angel3mAuthor
Inspiring
July 13, 2008
the code is on the security movieclip, not on the time frame.
kglad
Community Expert
Community Expert
July 13, 2008
is Security on the same timeline as the button that contains your code or is it in another movieclip and that (parent of Security) is on the same timeline as the button that contains your code?
Angel3mAuthor
Inspiring
July 13, 2008
Security is a movieclip button
Angel3mAuthor
Inspiring
July 13, 2008
btn_Security is a library name
that is inside 001 movie clip
and 001 instance name is Security

wud u like to view the .fla file?
kglad
Community Expert
Community Expert
July 13, 2008
library names are irrelevant for actionscript targeting and you can't have an object with instance name 001. so, i assume 001 is a library name which as i just mentioned is not helpful.

is Security a simple button or a movieclip button?
kglad
Community Expert
Community Expert
July 12, 2008
then you need to use the correct path to the other buttons. what movieclip are the other buttons in? (and security is not in that movieclip?)
Angel3mAuthor
Inspiring
July 12, 2008
the exact structure is:
scene -> Menu-Holder -> Rite-Menu -> Menu-Animation1 -> 001 -> btn-Security

in Menu-Animation1 all the button movie Clips are on different layers, like 001, 002, 003 and 004...

and btn-Security or btn-Development .... and so..... are in 001, 002......
how shud the path will be? and where i suppose to put it?


then you need to use the correct path to the other buttons. what movieclip are the other buttons in? (and security is not in that movieclip?)
kglad
Community Expert
Community Expert
July 12, 2008
layers are irrelevant. but if your buttons are movieclip buttons and not simple buttons that is relevant. and no flash objects can have instance names like btn-Security.

so, is that really supposed to be btn_Security or is that a library name and not an instance name?