Flash : Button Q
- Started
- Last post
- 5 Responses
- tobor
is there a code that disables all actions on a movie, but can be reinstated.
Like:
butt1.buttonAction = false;and reinstated like:
butt1.buttonAction = true;
- enjine0
button.enabled = 0;
if you want to reactivate it, button.enabled = 1;
- gabe0
you can either totally disable the button, e.g.
buttonOne.enabled = false;
or, set a variable within the button and check it before you execute the button's function, e.g.
buttonOne.enabledStatus = false;
on(release)
{
doSomething();
if( enabledStatus != false )
{
doSomethingElse();
}
}
- jkosoy0
If you want it for a MOVIE add the following to frame 1 of your maintimeline:
_global.enableMovie = function($mc,$state)
{
$state = Boolean($state);
var $i;
for($i in _root)
{
if(typeof $mc[$i] == "movieclip" || typeof $mc[$i] == "button")
{
$mc[$i].enabled = $state;
enableMovie($mc,$state);
}
};// to turn off
enableMovie(_root,0);// to turn on
enableMovie(_root,1);
- tobor0
You precious angels. You make papa so proud!!
thnx
- imakedesign0
set up a varible to check the state of the button. then write a simple if statement on your button press.