# Stop the Playhead at end of Timeline!

**URL:** <https://forum.kirupa.com/t/stop-the-playhead-at-end-of-timeline/296478>\
**Category:** flash\
**Created:** [September 15, 2009, 3:09pm UTC](https://forum.kirupa.com/t/stop-the-playhead-at-end-of-timeline/296478 "2009-09-15T15:09:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![madina](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@madina](https://forum.kirupa.com/u/madina)\
**Post date:** [September 15, 2009, 3:09pm UTC](https://forum.kirupa.com/t/stop-the-playhead-at-end-of-timeline/296478/1 "2009-09-15T15:09:44Z")

</div>

Hi There,  
Having spent ages on this I am resorting to forum for help.

I cannot get the timeline to stop on the last frame - when but02 is pressed it goes back to the first frame. How do I prevent this? The button should be inactive on the last frame.

1st frame in timeline has following code…

stop ();  
this.onEnterFrame = function(){  
if(rewind == true){  
prevFrame();  
}  
}

but01.onPress = function(){  
rewind = true;  
}

but02.onPress = function(){  
rewind = false;  
play();  
}

The buttons themselves have no code only instances. but01,but02  
Also along the timeline at each point I want the playhead to stop I have the folowing action in the frames…

stop ();  
rewind = false;

I have tried many workarounds but to no avail.

Your help would be much appreciated.  
Please find attached the file i am having problems with…

[http://ezine.catflapmag.com/slides.fla.zip](http://ezine.catflapmag.com/slides.fla.zip)

I hope somebody can help before I jump out of the adjacent window.

MC
