Forward and back between two frames at the press of a button

In the continuing evolution of my code, I simply want a button to alternate moving the playhead backwards and forwards along the timeline between frames 1 and 17. This code is not working. Any ideas? I have attached a screen capture to clarify your questions in advance :slight_smile:


on(press){
    var targetFrame = _parent._currentframe;
    //enter username
    if (targetFrame == 1){
        _parent.play();
    }
    //enter password
    else if(targetFrame == 17){
        for (var i:Number = 0; i<16; i++){
            _parent.prevFrame();
            trace(_parent._currentframe);            
        }
    }
    trace("Frame number=" + targetFrame)
}