topical media & game development

talk show tell print

lib-flex-animation-code-10-org-as3lib-kitchensync-core-Timestamp.ax

lib-flex-animation-code-10-org-as3lib-kitchensync-core-Timestamp.ax (swf ) [ flash ] flex


  package org.as3lib.kitchensync.core
  {
          
@ax-lib-flex-animation-code-10-org-as3lib-kitchensync-core-Timestamp encapsulates an instant as a frame int and a real time so that either may be used for calculating synchronicity.

  
           // todo rename currentTime and currentFrame to frames and milliseconds
          public class @ax-lib-flex-animation-code-10-org-as3lib-kitchensync-core-Timestamp
          {
                  private var _currentTime:int = 0;
                  public function get currentTime():int { return _currentTime; }
                  
                  private var _currentFrame:int = 0;
                  public function get currentFrame():int { return _currentFrame; }
                  
                  public function @ax-lib-flex-animation-code-10-org-as3lib-kitchensync-core-Timestamp(frame:int = 0, currentTime:int = 0) {
                          setTime(frame, currentTime);
                  }
                  
                  internal function setTime(frame:int = 0, currentTime:int = 0):void {
                          _currentFrame = frame;
                          _currentTime = currentTime;
                  }
                  
                  public function clone():@ax-lib-flex-animation-code-10-org-as3lib-kitchensync-core-Timestamp {
                          return new @ax-lib-flex-animation-code-10-org-as3lib-kitchensync-core-Timestamp(currentFrame, currentTime);
                  }
                  
                  public function toString():String {
                          return _currentTime + " msec; " + _currentFrame + " frames";
                  }
          }
  }


(C) Æliens 19/08/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.