# Continusly movement on button hold

**URL:** https://forum.kirupa.com/t/continusly-movement-on-button-hold/120001
**Category:** Uncategorized
**Created:** [August 19, 2004, 7:31pm UTC](https://forum.kirupa.com/t/continusly-movement-on-button-hold/120001 "2004-08-19T19:31:52Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![julpa](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@julpa](https://forum.kirupa.com/u/julpa)
#### Post date: [August 19, 2004, 7:31pm UTC](https://forum.kirupa.com/t/continusly-movement-on-button-hold/120001/1 "2004-08-19T19:31:52Z")

</div>

so yeah like it says i want to have a button and when you hold it a movie clip continusuly moves downward. so yeah.

basically there is no option that i can uses such as

on(hold);

cause well thats not a script. so anyways anyone know how i can do this? or how i can check to see if the mouse is pressed over the button?

---

<div class="post-metadata">

### Author: ![rberry88](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@rberry88](https://forum.kirupa.com/u/rberry88)
#### Post date: [August 19, 2004, 10:09pm UTC](https://forum.kirupa.com/t/continusly-movement-on-button-hold/120001/2 "2004-08-19T22:09:46Z")

</div>

Here, I’m not boasting or anything but look at the buttons on the top of my page and tell me if this is what you are talking about? I did my buttons as movieclips with a ‘dummy\_button’ over the top of them for the actionscript (i.e. rollOver,rollOut etc). This way it gives you more options as to what you want your buttons to act like.

My site: [http://rberry883.home.comcast.net](http://rberry883.home.comcast.net)

If this is not what you are looking for then disregard the above (and stop laughing at my site! 🙂 ) and someone who knows what they are doing can help you.

---

<div class="post-metadata">

### Author: ![Prophet](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Prophet](https://forum.kirupa.com/u/Prophet)
#### Post date: [August 19, 2004, 10:54pm UTC](https://forum.kirupa.com/t/continusly-movement-on-button-hold/120001/3 "2004-08-19T22:54:55Z")

</div>

give the movieclip an instance name, my example will be imaginatively named _myMC_ :P.

on your button, have an on(press) event as follows… assuming the movieclip is on the \_root level:

```auto
on (press) {
	_root.myMC.onEnterFrame = function(){
		this._y++
	}
}
on (release) {
	delete _root.myMC.onEnterFrame
}

```

note you mite want an on(releaseOutside) identical to on(release)

Prophet.

---

<div class="post-metadata">

### Author: ![Prophet](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Prophet](https://forum.kirupa.com/u/Prophet)
#### Post date: [August 19, 2004, 11:03pm UTC](https://forum.kirupa.com/t/continusly-movement-on-button-hold/120001/4 "2004-08-19T23:03:41Z")

</div>

thanks mattvenables… i didnt actually know that!! u learn sumit evryday 😉 lol

Prophet.

---

<div class="post-metadata">

### Author: ![rberry88](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@rberry88](https://forum.kirupa.com/u/rberry88)
#### Post date: [August 19, 2004, 11:22pm UTC](https://forum.kirupa.com/t/continusly-movement-on-button-hold/120001/5 "2004-08-19T23:22:51Z")

</div>

```auto
on(rollOver){
	gotoAndPlay("over");
}
on(press){
	gotoAndPlay("down");
}
on(rollOut, releaseOutside){
	gotoAndPlay("goback");
}
on(release){
	with(_root){
		gotoAndPlay("Home");
}
}

```

This is the actionscript for the dummy button that acts as the hit area of my movieclip buttons. Maybe not the cleanest I like it better than trying to get button symbols to behave with something more than just up,down,over.

---

<div class="post-metadata">

### Author: ![julpa](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@julpa](https://forum.kirupa.com/u/julpa)
#### Post date: [August 19, 2004, 11:41pm UTC](https://forum.kirupa.com/t/continusly-movement-on-button-hold/120001/6 "2004-08-19T23:41:43Z")

</div>

mattvenables, prophet worked great. anyways i guess with it being y++ theres no way i could speed it up without increasing the fps?

also another quick question, how do i load (or “activate”) a movie clip from a button.

anyways great replies.

---

<div class="post-metadata">

### Author: ![julpa](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@julpa](https://forum.kirupa.com/u/julpa)
#### Post date: [August 20, 2004, 9:07pm UTC](https://forum.kirupa.com/t/continusly-movement-on-button-hold/120001/7 "2004-08-20T21:07:12Z")

</div>

:bump:

---

<div class="post-metadata">

### Author: ![Prophet](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Prophet](https://forum.kirupa.com/u/Prophet)
#### Post date: [August 20, 2004, 11:27pm UTC](https://forum.kirupa.com/t/continusly-movement-on-button-hold/120001/8 "2004-08-20T23:27:21Z")

</div>

simply change _y++_ to _y+=x_ and rather than increase by 1, it will increase y by however many x represents (eg. _y+=5_)

give your mc an instance name and use its path to activate it: easiest way, have a blank frame on first frame and have action _stop()_ on it and then on your button use sumit like _\_root.myMC.play()_ wer _myMC_ is the instance name you gave it… assuming your mc is on the main timeline 😉

Prophet.

PS glad i could help 😉

---

<div class="post-metadata">

### Author: ![julpa](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@julpa](https://forum.kirupa.com/u/julpa)
#### Post date: [August 21, 2004, 7:14am UTC](https://forum.kirupa.com/t/continusly-movement-on-button-hold/120001/9 "2004-08-21T07:14:33Z")

</div>

wow i guess i was thinking it would be really complicated like \_root.load.function.math.pi(54%6);;{}sd.mymc i dunno oh well worked great again.

---

<div class="post-metadata">

### Author: ![Prophet](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Prophet](https://forum.kirupa.com/u/Prophet)
#### Post date: [August 21, 2004, 12:57pm UTC](https://forum.kirupa.com/t/continusly-movement-on-button-hold/120001/10 "2004-08-21T12:57:46Z")

</div>

happy flashing 🙂

Prophet.

---

<div class="post-metadata">

### Author: ![icio](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/icio/32/484_2.png) [@icio](https://forum.kirupa.com/u/icio)
#### Post date: [August 22, 2004, 3:02pm UTC](https://forum.kirupa.com/t/continusly-movement-on-button-hold/120001/11 "2004-08-22T15:02:59Z")

</div>

hehe. I love to flash 😉
