# Controlling the frame rate of a movieclip

**URL:** <https://forum.kirupa.com/t/controlling-the-frame-rate-of-a-movieclip/42709>\
**Category:** Uncategorized\
**Created:** [February 12, 2004, 2:47am UTC](https://forum.kirupa.com/t/controlling-the-frame-rate-of-a-movieclip/42709 "2004-02-12T02:47:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlkedave](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mlkedave](https://forum.kirupa.com/u/mlkedave)\
**Post date:** [February 12, 2004, 2:47am UTC](https://forum.kirupa.com/t/controlling-the-frame-rate-of-a-movieclip/42709/1 "2004-02-12T02:47:50Z")

</div>

I know how to change the frame rate of the whole movie but is there a way to change the frame rate of one movieclip? Thanks for your time.

Mike

---

<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:** [February 12, 2004, 2:57am UTC](https://forum.kirupa.com/t/controlling-the-frame-rate-of-a-movieclip/42709/2 "2004-02-12T02:57:51Z")

</div>

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=22316&](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=22316&)

---

<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:** [February 12, 2004, 3:04am UTC](https://forum.kirupa.com/t/controlling-the-frame-rate-of-a-movieclip/42709/3 "2004-02-12T03:04:34Z")

</div>

I’m not talking about external FLA’s, im jsut talking regulary movie clips, any suggestions?

---

<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:** [February 12, 2004, 3:05am UTC](https://forum.kirupa.com/t/controlling-the-frame-rate-of-a-movieclip/42709/4 "2004-02-12T03:05:21Z")

</div>

Have you read the thread?

---

<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:** [February 12, 2004, 3:09am UTC](https://forum.kirupa.com/t/controlling-the-frame-rate-of-a-movieclip/42709/5 "2004-02-12T03:09:39Z")

</div>

all of the replies, no i guess i jumped the gun 🙂

---

<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:** [February 12, 2004, 3:14am UTC](https://forum.kirupa.com/t/controlling-the-frame-rate-of-a-movieclip/42709/6 "2004-02-12T03:14:40Z")

</div>

The only problem is that code works great if you just play the movieclp but if you use a button to play a different frame (not the first frame, then it doesnt work. Suggestions?

Mike

---

<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:** [February 12, 2004, 3:37am UTC](https://forum.kirupa.com/t/controlling-the-frame-rate-of-a-movieclip/42709/7 "2004-02-12T03:37:42Z")

</div>

Try:

```auto
MovieClip.prototype.setFPS = function(rate, begin, end) {
	this.gotoAndStop(begin);
	this.begin = this._currentframe;
	this.end = end ? end : this._totalframes;
	this.controlFPS = function() {
		if (this.begin != this.end) {
			this.gotoAndStop(this.begin++);
updateAfterEvent();
		} else {
			delete this.control;
			delete this.begin;
			delete this.end;
			clearInterval(this.my_interval);
		}
	};
	this.my_interval = setInterval(this, "controlFPS", 1000/rate);
};
myMovieClip.setFPS(25, 10, 30);
//fps rate,initial frame, final frame

```
