as my previous post
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=28
8&threadid=1376794&enterthread=y
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
kglad - 11 Jul 2008 00:07 GMT
use use your buttons' _visible or enabled property.
Angel3m - 11 Jul 2008 00:26 GMT
thnx for reply kGlad
may i know where to use these properties?
sorry im not that familiar with terms that much...
Thnx again
kglad - 11 Jul 2008 02:50 GMT
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
Angel3m - 11 Jul 2008 22:42 GMT
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 - 11 Jul 2008 22:48 GMT
is your security button disabled when you execute that code?
Angel3m - 11 Jul 2008 22:52 GMT
yes, if the code is under On Release Action
kglad - 11 Jul 2008 22:57 GMT
and why can't you disable any more buttons?
kglad - 11 Jul 2008 22:57 GMT
and why can't you disable any more buttons?
Angel3m - 11 Jul 2008 23:02 GMT
what can i say.... :(
is there any other way??
kglad - 11 Jul 2008 23:08 GMT
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?
Angel3m - 11 Jul 2008 23:39 GMT
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.....
kglad - 12 Jul 2008 00:38 GMT
show the code that you used to try and disable your buttons.
Angel3m - 12 Jul 2008 07:26 GMT
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;
}
kglad - 12 Jul 2008 15:03 GMT
do you have a button with instance name development that's on the same timeline as security and it fails to be disabled?
Angel3m - 12 Jul 2008 19:36 GMT
no ... all the buttons are on different time line... but in 1 mc
kglad - 12 Jul 2008 20:36 GMT
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?)
Angel3m - 12 Jul 2008 21:35 GMT
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 - 12 Jul 2008 21:52 GMT
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?
Angel3m - 13 Jul 2008 13:54 GMT
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 - 13 Jul 2008 16:11 GMT
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?
Angel3m - 13 Jul 2008 18:52 GMT
Security is a movieclip button
kglad - 13 Jul 2008 21:03 GMT
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?
Angel3m - 13 Jul 2008 22:25 GMT
the code is on the security movieclip, not on the time frame.
kglad - 14 Jul 2008 03:20 GMT
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.
Angel3m - 14 Jul 2008 06:43 GMT
here i ve uploaded the file. Plz download it:
http://www.adhabi.com/docs/menu.zip
Thank you
kglad - 14 Jul 2008 07:08 GMT
if you want to hire me to solve your problem send me an email via my website.
Angel3m - 15 Jul 2008 21:57 GMT
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
Venian - 16 Jul 2008 13:14 GMT
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;
}