# MX2004 help: pausing a movieclip that's moving via actionscript

**URL:** https://forum.kirupa.com/t/mx2004-help-pausing-a-movieclip-thats-moving-via-actionscript/63545
**Category:** flash
**Created:** [September 7, 2004, 9:01pm UTC](https://forum.kirupa.com/t/mx2004-help-pausing-a-movieclip-thats-moving-via-actionscript/63545 "2004-09-07T21:01:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![DavidCastillo](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@DavidCastillo](https://forum.kirupa.com/u/DavidCastillo)
#### Post date: [September 7, 2004, 9:01pm UTC](https://forum.kirupa.com/t/mx2004-help-pausing-a-movieclip-thats-moving-via-actionscript/63545/1 "2004-09-07T21:01:58Z")

</div>

stupid question, I know, but for some reason I can’t get it to work right. any help is appreciated.

here’s what I have going on so far–I have a movieclip that’s acting as a continuously scrolling text field, and want it to stop scrolling onMouseDown.

here’s my code right now:

```auto
onClipEvent (enterFrame) {
	location = this._y;
	var i;
	i = -1;
	if (this._y<-700) {
		this._y = 900;
	}
	else {
		this._y = location+i++;
	}
}

```

---

<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: [September 7, 2004, 10:13pm UTC](https://forum.kirupa.com/t/mx2004-help-pausing-a-movieclip-thats-moving-via-actionscript/63545/2 "2004-09-07T22:13:06Z")

</div>

```auto
onClipEvent(load) {
   shouldMove = true;
}

onClipEvent (enterFrame) {
   if (shouldMove) {
      location = this._y;
      var i;
      i = -1;
      if (this._y<-700) {
          this._y = 900;
      } else {
          this._y = location+i++;
      }
   }
}

```

and on the mouseDown and mouseUp we will need to define the variables:

```auto
onClipEvent(mouseDown) {
   shouldMove = false;
}

onClipEvent(mouseUp) {
   shouldMove = true;
}

```

that should do it 🙂

---

<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: [September 8, 2004, 2:29pm UTC](https://forum.kirupa.com/t/mx2004-help-pausing-a-movieclip-thats-moving-via-actionscript/63545/3 "2004-09-08T14:29:38Z")

</div>

that worked like a charm!

thanks!
