title: Using nextFrame(), prevFrame(), and gotoAndStop() to navigate
body: <p>I'm trying to make an easy image galleri (one photo each frame), and then two buttons to navigate right/left. When it gets to the final frame, it jumps back to the first if you click next and vice versa for left.</p>
  
  <p>The problem with the code is that I'm only able to jump back to last frame, and forth to first frame again.</p>
  
  <p>Here's the code. </p>
  
  <p>Left button:</p>
  
  <pre><code>on (release) {
  if (_currentframe = 1) {
      gotoAndStop(_totalframes);
  } else {
     prevFrame();
  }    
  }
  </code></pre>
  
  <p>Right button:</p>
  
  <pre><code>on (release) {      
      if (_currentframe = _totalframes) {
      gotoAndStop(1);
      }
      else
      {   
      nextFrame();
      }
  }
  </code></pre>