Button Down State to Stay Active onRelease?

Hello everyone. What is the simplest way to make a button’s down state stay active when the user presses it? I found out how to do it with movie clips with the following AS:

movieClip.onRollOver = function () {
gotoAndStop(“over”);
};

movieClip.onPress = function () {
gotoAndStop(“down”);
};

movieClip.onRelease = function () {
gotoAndStop(“hit”);
};

…but I want to keep the items as buttons. Thanks again.

Scottie

Well, exactly the same. You can give instance names to buttons too (but it’s much more practical to use movie clips all the time).

pom :slight_smile:

Instead of “movieClip.onRelease” do I state “button.onRelease”? (Don’t have access to Flash right now).

Scottie

Well, yeah. If your button’s instance name is myButton, then you whould write

myButton.onRollOver=function(){};

pom :hair:

Re: my original question, where do I place the mc code? I created an MC called “RSVP_mc”. Inside the “RSVP_mc” movie clip timeline I’ve created 4 frames, labeled respectively up, over, down and hit, placing the appropriate graphic on each frame. Also, each frame has a stop() action. Then, back on the mc itself on the main timeline I’ve added the following AS:

onClipEvent (load) {
RSVP_mc.onRollOver = function() {
this.gotoAndStop(“over”);
};
RSVP_mc.onPress = function() {
this.gotoAndStop(“down”);
};
RSVP_mc.onRelease = function() {
this.gotoAndStop(“hit”);
};
}

Nothing happens. Am I putting things in the right place? Also, I’d like it to load a .swf into an empty MC on the stage once clicked. What script do I add at the end, and where? I await your genius…

*<:) Scottie

How about this… Is there a way to add some AS to a basic button to make it “stick” in the down state? That would be so much easier!