ok. Im sure this is an easy one for most of you, but i have been looking for a solution myself for a couple of weeks and am not advanced enough to figure this one out.
this code below is taken from a great thread in 2007, but have edited it to have a reverse button. The problem i am having is getting the “fwd” to not work once it reaches the end of the timeline. Currently when i press “fwd” when it is at the end of the timeline, it goes back to the beginning without reversing. I want to not be able to do anything to the “fwd” button and this reverse job to only be taken by the “bck” button. Apart from this it all works so it seems ashame to not figure this small bit out.
stop();
var rewind:Boolean;
hitArea = fwd;
hitArea = bck;
fwd.addEventListener(Event.ENTER_FRAME, ef);
fwd.addEventListener(MouseEvent.MOUSE_DOWN, click1);
bck.addEventListener(MouseEvent.MOUSE_DOWN, click2);
function ef(event:Event):void {
if(rewind) this.prevFrame();
}
function click1(event:MouseEvent):void {
rewind = false;
this.play();
}
function click2(event:MouseEvent):void {
rewind = true;
}
many thanks.