# "prevFrame"

**URL:** <https://forum.kirupa.com/t/prevframe/76708>\
**Category:** flash\
**Created:** [January 20, 2005, 8:18pm UTC](https://forum.kirupa.com/t/prevframe/76708 "2005-01-20T20:18:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rlbaris](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@rlbaris](https://forum.kirupa.com/u/rlbaris)\
**Post date:** [January 20, 2005, 8:18pm UTC](https://forum.kirupa.com/t/prevframe/76708/1 "2005-01-20T20:18:24Z")

</div>

i worte a script that makes my MC to play back and forward; my qestion is how can i change the sctipt that my MC will play only after i press him (OnPress)and will stop at the end’ and play it back by prevFrame only after i hit him agine.

thanks!

this is my script:

```auto
 onClipEvent (enterFrame) {
if (this._currentframe == this._totalframes-1) {
trace("end of internal frames");
this.onEnterFrame = function() {
	 trace("backwords step");
	 prevFrame();
	 if (this._currentframe == 1) {
		 this.onEnterFrame = "";
		 trace("first frame");
		 play();
	 }
};
}
}

```
