home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2012 April / ME_04_2012.iso / Video-Tutorial / iPhoto / media / player.swf / scripts / mx / resources / ResourceManager.as < prev    next >
Encoding:
Text File  |  2011-11-11  |  1.1 KB  |  44 lines

  1. package mx.resources
  2. {
  3.    import flash.utils.getDefinitionByName;
  4.    import mx.core.Singleton;
  5.    import mx.core.mx_internal;
  6.    
  7.    use namespace mx_internal;
  8.    
  9.    public class ResourceManager
  10.    {
  11.       private static var implClassDependency:ResourceManagerImpl;
  12.       
  13.       private static var instance:IResourceManager;
  14.       
  15.       mx_internal static const VERSION:String = "4.5.0.20967";
  16.       
  17.       public function ResourceManager()
  18.       {
  19.          super();
  20.       }
  21.       
  22.       public static function getInstance() : IResourceManager
  23.       {
  24.          if(!instance)
  25.          {
  26.             if(!Singleton.getClass("mx.resources::IResourceManager"))
  27.             {
  28.                Singleton.registerClass("mx.resources::IResourceManager",Class(getDefinitionByName("mx.resources::ResourceManagerImpl")));
  29.             }
  30.             try
  31.             {
  32.                instance = IResourceManager(Singleton.getInstance("mx.resources::IResourceManager"));
  33.             }
  34.             catch(e:Error)
  35.             {
  36.                instance = new ResourceManagerImpl();
  37.             }
  38.          }
  39.          return instance;
  40.       }
  41.    }
  42. }
  43.  
  44.