title: Update prototype variable Javascript
body: <p>I'm working on a project where i need to return a framecount from a playing video via the method <code>video.prototype.getCurrentFrame()</code>. my script works pretty much fine exept that the number that is returned by this method is 'undefined'. I know that my problem has to do something with the scope of my variables but I'm new in javascript and I can't seem to make it work on my own ... </p>
  
  <p>In my method <code>video.prototype.setUpPlayer</code> I have a function that allows me counting the framcount <code>'timeListener'</code> where I update a variable called frame; 
  If I try to access this frame variable throught <code>video.prototype.getCurrentFrame()</code> it doesnt reach the updated value. </p>
  
  <p>here is my code so far : </p>
  
  <pre><code>var Video = function(aVideoId){
  this.videoId = aVideoId;
  this.frame;
  this.videoContainer; 
  this.myPlayer;
  this.timeListener;
  this.progressListener;
  };
  
  Video.prototype.getCurrentFrame = function(){
      return this.frame;
  }
  
  Video.prototype.setVideoContainer = function(){
          videoContainer = $('&lt;div&gt;', {
          id: this.videoId,
          class: 'projekktor',
          width: "100%",
          height: "100%",
      });
      $('#innerContainer').html(videoContainer);
  }
  
  Video.prototype.setUpPlayer = function(){
      videoId = this.videoId;
  
  
      myPlayer = projekktor('#' + videoId, {
          controls: "true",
          volume: 0.5,
          preload: false,
          autoplay: true,
          playlist: [{
              0: {
                  src: '/' + videoId + '.mp4',
                  type: 'video/mp4'
              },
              1: {
                  src: '/' + videoId + '.mov',
                  type: 'video/mov'
              },
              2: {
                  src: '/' + videoId + '.ogv',
                  type: 'video/ogv'
              }
          }]
      }, function() { // call back
          myPlayer.addListener('time', timeListener);
          myPlayer.addListener('progress', progressListener);
      });
  
      timeListener = function(duration) {
              $('#currentTime').html(duration);
              frame = Math.round(duration * 25);
              $('#currentFrame').html(frame); 
                              return this.frame = frame;
  
  
          }
  
      progressListener = function(value) {
              $('#progress').html(Math.round(value))
              $('#progress2').html(myPlayer.getLoadProgress());
          }   
  }
  </code></pre>
  
  <p>Thanks in advance for your help ! </p>