topical media & game development

talk show tell print

lib-flex-animation-code-10-org-as3lib-kitchensync-KitchenSync.ax

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


  package org.as3lib.kitchensync
  {
          import flash.display.DisplayObject;
          import flash.errors.IllegalOperationError;
          
          import org.as3lib.kitchensync.core.Synchronizer;
          
  
          
Gateway to the library. Initializes the entire system. @use @ax-lib-flex-animation-code-10-org-as3lib-kitchensync-KitchenSync.initialize(this, versionNumber); @since 1.2
author: Mims H. Wright
see: org.as3lib.kitchensync.core.Synchronizer

   
          public final class @ax-lib-flex-animation-code-10-org-as3lib-kitchensync-KitchenSync
          {
                  
The current version of the library. Use this to verify that the library is the version that your software expects.

   
                  public static const VERSION:String = "1.6"
                  private static var _initialized:Boolean = false;
                  
                  
Initializes the timing core for @ax-lib-flex-animation-code-10-org-as3lib-kitchensync-KitchenSync. Must be called before using any actions.
parameter: frameRateSeed must be a DisplayObject that is added to the display list.
parameter: versionCheck a string for the version you think you're using. e.g. 1.2 This is recommended but not required. It will throw an error if you're using the wrong version of KS.

  
                  public static function initialize(frameRateSeed:DisplayObject, versionCheck:String = VERSION):void
                  {        
                          
                          if (_initialized) {
                                  // todo make this error optional.
                                  throw new IllegalOperationError("@ax-lib-flex-animation-code-10-org-as3lib-kitchensync-KitchenSync has already been initialized.");
                          }
                          if (versionCheck != VERSION) {
                                  throw new Error ("Version check failed. Please update to the correct version or to continue using this version (at your own risk) put the initialize() method inside a try{} block.");
                          }
                          var synchronizer:Synchronizer;
                          synchronizer = Synchronizer.getInstance();
                          synchronizer.frameRateSeed = frameRateSeed;
                          _initialized = true;
                  }
                  
                  public function @ax-lib-flex-animation-code-10-org-as3lib-kitchensync-KitchenSync () {
                          throw Error ("There is no need to instantiate this class. use @ax-lib-flex-animation-code-10-org-as3lib-kitchensync-KitchenSync.initialize() instead");
                  }
          }
  }
  
  


(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.