-
Shop Buy Buttons States
Hey all,
How can I make a button that looks "grayed out" when it doesn't meet some requirement (like gold).
For example, if i'm on a shop and don't have any gold to buy a item, the button should be greyed out and clicking on it will do nothing.
When you have enough gold, the color returns and the buy button works properly.
Initially, I tried to achieve this with buttons, with help of the following properties:
PHP Code:
if( player doesn't have money to buy item)
{
buyButton.enabled = false;
buyButton.visible = false;
}
else
{
buyButton.enabled = true;
buyButton.visible = true;
}
While this method works, it isn't perfect. Even if the players don't have gold to buy a item, I would like to have a gray "Buy" button next to the item. That way, players will undertand they don't have gold.
How do you achieve this? With movieclips or is there a function in Actionscript 3.0 that allows your buttons to get this effect?
Thanks.
-
I think one of the more common ways is to use a movie clip and switch frames via gotoAndStop().
-
That's what I thought. But how can I create the mouseover effect in a movieclip (move cursor over button: text/button color changes)? Don't I have to create a function for that?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|