# Keeping buttons pressed down?

**URL:** <https://forum.kirupa.com/t/keeping-buttons-pressed-down/8438>\
**Category:** Uncategorized\
**Created:** [November 21, 2002, 7:10am UTC](https://forum.kirupa.com/t/keeping-buttons-pressed-down/8438 "2002-11-21T07:10:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonmi](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@sonmi](https://forum.kirupa.com/u/sonmi)\
**Post date:** [November 21, 2002, 7:10am UTC](https://forum.kirupa.com/t/keeping-buttons-pressed-down/8438/1 "2002-11-21T07:10:20Z")

</div>

i’m not really sure if this requires a script, but i guess i’ll pose the question here anyway. is there a way to keep buttons pressed down after you click on them? like, to maintain the “down” look as opposed to going back to the “up” ? and this is to be without the use of a new scene or movie or whatever. just in one frame, to have a button be clicked on, and for the button to remain at that state. :-\

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 21, 2002, 7:14am UTC](https://forum.kirupa.com/t/keeping-buttons-pressed-down/8438/2 "2002-11-21T07:14:14Z")

</div>

How about you use a movie clip as a button. Have 4 labelled keyframes: ‘up’, 'over, ‘down’, ‘hit’. Make the movie clip go to a certain frame depending on what the user is doing.

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

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

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

Any more questions, don’t hesitate to yell at me. I may be a liar, but I love to help!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 21, 2002, 7:59am UTC](https://forum.kirupa.com/t/keeping-buttons-pressed-down/8438/3 "2002-11-21T07:59:49Z")

</div>

though keep in mind that Dan is proposing an MX solution. If it’s Flash5.0 it’s a little more tricky.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 21, 2002, 5:19pm UTC](https://forum.kirupa.com/t/keeping-buttons-pressed-down/8438/4 "2002-11-21T17:19:00Z")

</div>

ah, thanks! i’ve actually switched to flash mx now, so hopefully i can get this to work.

what i’m doing is having a bunch of the same button on one frame. if i were to do this, it wouldn’t give the same action to all the other buttons, would it?

so basically all i do is make a new movie, insert 4 keyframes, then go to “frame label” and label each accordingly? i don’t add any code to the individual keyframes though, right?

i feel so ignorant :pirate:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 21, 2002, 8:59pm UTC](https://forum.kirupa.com/t/keeping-buttons-pressed-down/8438/5 "2002-11-21T20:59:09Z")

</div>

The code on each individual clip will not matter as long as you give all your movie clips instance names: i.e. ‘home’, ‘links’, ‘contact’, etc.

You must also place a **stop();** action on each of the four frames so that the movie clip does not play.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 15, 2003, 4:33am UTC](https://forum.kirupa.com/t/keeping-buttons-pressed-down/8438/6 "2003-01-15T04:33:21Z")

</div>

I 'm trying to do this too and couldn’t get it to work.

I created an MC called “RSVPmc”. Inside the “RSVPmc” 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:

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

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

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

Any event handlers or something else missing? Am I putting things in the right place? (obviously not!)

\*\<:) Scottie
