Making buttons UNclickable

I’m making a game in which you shoot gophers(don’t ask). The weapon is a shotgun…I have a custom cursor, and for the cursor I have 12 frames(1 seconds worth)…on frame one it’s a normal cursor and all buttons should be clickable, but on frames 2-12, i have the shotgun firing and reloading sounds playing, and I don’t want any buttons(gophers) to be clickable…because right now i can shoot any of them even while the shotty is reloading…i’ve tried the button.enabled function but it doesn’t work…it doesn’t even return a trace.PLEASE HELP!
TIA

Well, you’re on the right track, because enabled is what you would use. Are you using as part of an “enterframe” event? Also, make sure your code is not “breaking out” of the area where your buttons (mc’s) are no longer enabled.

Actually, i wasn’t using it as an enterframe event because i have no idea how it’s used…because if i try it inside of the movie clip, it tells me that the action can only be assigned to movie clips and not frames…
here’s my setup:
main movie:
cursor movie clip with sound:
animated movie clip:
button which i want disabled
ok, so i want it to work like this…
when the cursor clip goes to frame 2 the button should be disabled…when the cursor clip goes to frame 1, button should be enabled.
also, i tried to trace the button.enabled = but it wont give me a true/false value.
here’s the fla(plz don’t steal my idea even thou this is just a test)
i removed the button enabled function so i wouldn’t get errors and extra code…
plz try to get something to work
TIA

:wink:

  1. you didnt post your fla
  2. I’ve never seen anyone steal anyone else’s ideas here.
  3. A good number of people here can make some pretty complicated flash… I wouldnt worry too much.

In the meantime, you could also try some if/then statements

as in

if (this.currentframe==1){button.enabled=true;}else{button.enabled=false;} or something like that…

head looking for pillow…need rest… I’ll check that code in the morning…

really sorry…forgot to attach…hope i won’t forget in this post(lol)
PS - that’s for the this.currentframe==…i never used that before so i forgot about it…i’ll try that
ahh…file too big…i’m gonna take out some pics…hope it doesn’t ruin anything…
by the way…the button is inside the face1 movieclip

ok, since the file i posted has a button removed, i’m posting a link with the full fla file(which should just open in flash when u click on the link):
www.flashtek.devisland.net/gopherhunt.fla
there is some code in there…my attempt at making the button enabled=false…although it doesn’t work with the variable…still need help!

update:
i sorta got it to work now…it disables/enables the buttons with this code upon entering certain frames of my cursor movie clip:
tellTarget("/face1") {
face1button.enabled = true;
}
tellTarget("/face2") {
face2button.enabled = true;
}
However, there’s a little glitch: if i click on face1button, face2button will be disabled, but since face1button reappears before the shotty has time to reload i can shoot it again, and it’s enabled, so it will still shoot even though the shotty is still reloading.
can anyone think of any code that will disable the button?

you could create a variable that states the gun is reloading

if (_root.reloading=true){
button.enabled=false;}

get it?

I mostly get it, but where would i write put the code that you gave me? Would it be in the movie clip containing the button, or in the cursor movie clip? Also, since i’m kinda new at flash, why do you put _root in front of the variable?