Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

disable button

Explorer ,
Jul 10, 2008 Jul 10, 2008
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
TOPICS
ActionScript
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2008 Jul 10, 2008
use use your buttons' _visible or enabled property.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 10, 2008 Jul 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 10, 2008 Jul 10, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 11, 2008 Jul 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2008 Jul 11, 2008
is your security button disabled when you execute that code?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 11, 2008 Jul 11, 2008
yes, if the code is under On Release Action
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2008 Jul 11, 2008
and why can't you disable any more buttons?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2008 Jul 11, 2008
and why can't you disable any more buttons?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 11, 2008 Jul 11, 2008
what can i say.... :(
is there any other way??


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2008 Jul 11, 2008
there are, almost always, many ways to get things done in all programming languages including actionscript. but you shouldn't give up on one way without some reason.

so, why can't you disable other buttons using the same technique used for your security button?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 11, 2008 Jul 11, 2008
well of course this is no the end

my friend, i really don't have any idea why its not working...

maybe we should try some other way.....
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2008 Jul 11, 2008
show the code that you used to try and disable your buttons.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 11, 2008 Jul 11, 2008
here is the code:

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;
development.enabled=false;
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 12, 2008 Jul 12, 2008
do you have a button with instance name development that's on the same timeline as security and it fails to be disabled?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 12, 2008 Jul 12, 2008
no ... all the buttons are on different time line... but in 1 mc

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 12, 2008 Jul 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?)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 12, 2008 Jul 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?)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 12, 2008 Jul 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?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 13, 2008 Jul 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?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 13, 2008 Jul 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?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 13, 2008 Jul 13, 2008
Security is a movieclip button
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 13, 2008 Jul 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?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 13, 2008 Jul 13, 2008
the code is on the security movieclip, not on the time frame.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 13, 2008 Jul 13, 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines