public void goToFrame(int frame)
  {
    this.currentFrame = frame;  
    if (currentFrame > images.size()-1)
    {
      if (isLooping == true)
        currentFrame = 0;
      else
        currentFrame = images.size() -1;
    }
  }