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

  1. package mx.resources
  2. {
  3.    import flash.system.ApplicationDomain;
  4.    import mx.core.mx_internal;
  5.    
  6.    use namespace mx_internal;
  7.    
  8.    public class ResourceBundle implements IResourceBundle
  9.    {
  10.       mx_internal static var locale:String;
  11.       
  12.       mx_internal static var backupApplicationDomain:ApplicationDomain;
  13.       
  14.       mx_internal static const VERSION:String = "4.5.0.0";
  15.       
  16.       mx_internal var _bundleName:String;
  17.       
  18.       private var _content:Object = {};
  19.       
  20.       mx_internal var _locale:String;
  21.       
  22.       public function ResourceBundle(param1:String = null, param2:String = null)
  23.       {
  24.          super();
  25.          this.mx_internal::_locale = param1;
  26.          this.mx_internal::_bundleName = param2;
  27.          this._content = this.getContent();
  28.       }
  29.       
  30.       private static function getClassByName(param1:String, param2:ApplicationDomain) : Class
  31.       {
  32.          var _loc3_:Class = null;
  33.          if(param2.hasDefinition(param1))
  34.          {
  35.             _loc3_ = param2.getDefinition(param1) as Class;
  36.          }
  37.          return _loc3_;
  38.       }
  39.       
  40.       public function get bundleName() : String
  41.       {
  42.          return this.mx_internal::_bundleName;
  43.       }
  44.       
  45.       public function get content() : Object
  46.       {
  47.          return this._content;
  48.       }
  49.       
  50.       public function get locale() : String
  51.       {
  52.          return this.mx_internal::_locale;
  53.       }
  54.       
  55.       protected function getContent() : Object
  56.       {
  57.          return {};
  58.       }
  59.       
  60.       private function _getObject(param1:String) : Object
  61.       {
  62.          var _loc2_:Object = this.content[param1];
  63.          if(!_loc2_)
  64.          {
  65.             throw new Error("Key " + param1 + " was not found in resource bundle " + this.bundleName);
  66.          }
  67.          return _loc2_;
  68.       }
  69.    }
  70. }
  71.  
  72.