Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : how do I do this? Movieclip prob



Mike7222
5/29/2004 11:28:26 PM
Hi chaps,

I have serveral buttons on the main movie. When I click one, and new movie
pops up and takes up about 50% of the main movie clip.
I want to disable access to the buttons on the main movie clip while this new
clip is running.
I was looking at the setFocus statement but couldt figure out if this was the
right direction to take..

Cheers

Mike
rlc5611
5/30/2004 3:16:42 AM
say you have five buttons with instance names button1, button2, etc. and one of
these buttons (first one for example), loads the clip. For this button you
could use:

on(release) {
//load your clip here
for(i=1;i<=5;i++) {
eval("button" + i).enabled = false;//disable all the buttons
}

then when the clip finishes, reenable the buttons.
}
Mike7222
5/30/2004 4:28:40 AM
Thanks alot for your reply.

I have inserted the code you wrote and it does the job in disabling the
buttons.
I?m just have trouble getting them re enabled now.

I put the enabled = true where you suggested, but becuase of what is already
going on in the code it doesn?t work (they stay disabled after the movie
finished). I?m not sure where I can put the enabled line to get it re enabled
again?

heres the code I am using.

for(var n=0; n < MyBtns.length; n++){
this[MyBtns[ n ]].onRelease=function(){
aTemp = this._name.split("But");
num = aTemp[ 1 ];
for(i=1;i<=5;i++) {
eval("but" + i).enabled = false;//disable all the buttons

}
CallAlpaMov (MyClips[ num ],MyClips[ num ], 1, 400, 300);
};
}

thanks, Mike
rlc5611
5/30/2004 6:36:02 AM
If you want it reenabled only after the movie clip finishes then in the last
frame of the movie clip you could put:

for(i=1;i<=5;i++) {
eval("_parent.but" + i).enabled = true;//need correct path back to buttons here
}

this assumes the buttons are in the parent of the movie clip or, if they are
in their own clip you could use "_root.mclip.but" ("mclip" being the name of
their clip). You can definitely reenable the buttons but the path will have to
be correct.

Mike7222
5/30/2004 1:55:06 PM
spot on, thanks alot. I did that before but wasnt specifying the correct path.

cheers

AddThis Social Bookmark Button