View Full Version : Buttons unselectable
nobodyimportant
04-02-2005, 01:58 PM
Hello everyone,
I'm just curious if its possible to make buttons unselectable for a certain range of frames. I don't wanna make the buttons disappear, I want them to be there but just not clickable. I have three or so other buttons on the stage that will be selectable, one of which will make the main menu move (temporarily) and during that time I don't want the buttons that will move to be clickable (though I still want them to be there ... so I don't just wanna delete them or fade them out for these frames).
Any help greatly appreciated, thanks.
You have a number of choices.
You can disable the buttons by changing the enabled property for each to false. The will leave the buttons visible but will result in the regular cursor not changing to a hand cursor when over those buttons.
If you want the hand cursor to still appear when over the buttons, but have them do nothing when clicked, you can set a variable that is checked by a conditional in each of the button actions, and performing the action assigned to the button only if the condition is satisfied.
nobodyimportant
04-02-2005, 11:06 PM
Cool, thanks for responding.
Do you think you could explain the enabled property to me though?
In the mean time I'll google it and check the main page and tutorial section to see if I can find out about it, thanks.
nobodyimportant
04-02-2005, 11:30 PM
myButton.enabled = false;
would be the code I guess?
But I have a problem with that, you see its not actually a button. Its a Movie Clip with tweens inside and such, then it has a button inside the movie clip.
So in the edit mode, it essentially goes:
Scene >> Movie Clip >> Button
Now I need to disable the button (movie clip) for 10 or so frames in the scene, so I think using the button.enable = false is something that only works on buttons and not movieclips?
Hmmm, not sure what to do about it. :/
It works on whatever object has a button event handler function applied to it (or an on() event -- if it's inside a movieclip, you'll have to provide the path to the button's instance name. If the button in the movieclip does not exist at the time you need to set the enabled property, then you cannot use that technique, as you cannot target any object that does not yet exist.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.