Inactive buttons

hey sorry to be repeating a thread, i just cant find where the thread is of how to make a button inactive.

What i want to do, is when a external movie is loaded i want its button which is on the main timeline to become inactive , maybe greyed out or have a constant mouse over.

Any help will be appreciated.

thanx :smirk:

try this code:

button.enabled = false;

thanxs Guig0, i found the thread i was looking for though, but that was part of what i wanted.

thanx

anytime! =)

ok kool, turned the button off, all is good, but if i was to want the button that was just pressed to be able to show that it is in that buttons section. like have it on its over state constantly till another section ( button) is pressed.

Wow… I am sure there is an easier way with actionscript, but it isn’t coming to me.

(This is going by using movie clips as buttons in MX)
What you can do though is set a variable… something like…

homeButtonActive = true

Then you can set an if statement checking if it is true.

onClipEvent(enterFrame){
if (homeButtonActive == true){
this.onPress = function(){
 this.gotoAndStop(2);
 this.enabled = false;
}
} else (
 this.gotoAndStop(1);
 this.enabled = true;
}
}

What this says that if the homeButtonActive variable equals true then when the button is pressed it will gotoAndStop on the 2nd frame of the button MC (in which the over state of your clip will be) and if the homeButonActive equals false, then it will go back to frame 1 and re enable the button.

Make any sense?

edit: oh yeah… your button mc will have 2 frames… 1 regular and 1 over. Each frame should have a stop() action on it.

what if you were to use buttons that had , over and out actions on it, such as a arrow tween in on mouse over and arrow tween out on mouse out, and what i wanted to keep there as indication to the area currently in a red arrow which is static.

can the same code be used?

Well the code given was just a method. It was meant to show you how a variable could be implemented into a situation like that.

You can chage the gotoAndPlays and gotoAndStops to whatever you want.

And on MCs in Flash MX you can use on handlers so you can do the on (rollOver) on an MC like you can on a button.

ok kool, thanks lost ill give it a go.

I wish you luck.

It is 3:30am here now… I am very tired…lol.

I bid you farewell :slight_smile: