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

kglad
Community Expert
Community Expert
July 11, 2008
is your security button disabled when you execute that code?
Angel3mAuthor
Inspiring
July 11, 2008
hi,
i did tried to put in the button code of my previous issue

on (release) {
// 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;
}

i can't add any more buttons to disable them
like after
security btn
if i add
development btn
only
security btn
will be disabled... all other btnz will be working.
i want like, on click all the buttons gets disabled and in the external movie clip, when i click the CLOSE btn, all buttons gets enabled.

i found the following code.

for (var name in this) {
if (typeof (this[name]) == "movieclip") {
for (var name1 in this[name]) {
if (typeof (this[name][name1]) == "object") {
this[name][name1].enabled = false;
}
}
}
}

but i don't know the right place to add this code. though it works fine.
disables all the btns with the name. again i wud like to put the structure of my file:

1. main container of left and rite menu, single layer

2. 2 layers. down layer -> right menu. up layer -> left.

Now if we enter in right menu mc....

3. animation of right menu

4. in animation mc there are 4 buttons animation tweening

5. button container with actionScript on button

6. Button


any ideas plz?

kglad
Community Expert
Community Expert
July 11, 2008
you can use them just about anywhere that suits you. but it's best to attach code to a frame. in your case, you should attach it to a frame that contains your buttons and you should execute the code when you want to disable your buttons.

for example, when you execute your loadMovie() (or loadMovieNum() or loadClip() statement), you can execute:

btn1.enabled=false;
btn2.enabled=false; // etc
kglad
Community Expert
Community Expert
July 10, 2008
use use your buttons' _visible or enabled property.
Angel3mAuthor
Inspiring
July 10, 2008
thnx for reply kGlad

may i know where to use these properties?
sorry im not that familiar with terms that much...

Thnx again