adv banner
Flash & Swish  Home Flash & Swish Swish Tutorials Button Disable/Enable
rss

Button Disable/Enable

Author: Craig Lowe More by this author


Example:

Click on the buttons above to disable and enable buttons when clicked.

Lets start by opening SwishMax, set you movie size for your buttons.

Step. 1

Select the Rectangle tool and create a button shape like in the example above

Also select the colour of the rectangle.

Now select the Text tool and type what you wish your button to say, example "HOME".

Once you have the rectangle and the text placed over the top of the rectangle,

Select both items and group together as a sprite, then group the sprite as a button.

Now select the button and give it a separate over and down state.

Change the rectangle and text colour in the over and down state the same colour but different from the up state.

Step. 2

Add the following code to the button.

on (release) {
home.enabled = false;
}

To enable the button again add the following code to another button.

on (release) {
home.enabled = true;
}

To create more buttons just follow steps 1 and 2 again, or download the example file below.




Rate this Material: Bad 1 2 3 4 5 Excellent
print this page tell a friend subscribe to newsletter subscribe to rss

Add comments to "Button Disable/Enable"