home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Puzzle / filler.swf / scripts / mx / core / ComponentDescriptor.as < prev    next >
Encoding:
Text File  |  2008-09-02  |  1.7 KB  |  78 lines

  1. package mx.core
  2. {
  3.    use namespace mx_internal;
  4.    
  5.    public class ComponentDescriptor
  6.    {
  7.       
  8.       mx_internal static const VERSION:String = "2.0.1.0";
  9.        
  10.       
  11.       public var events:Object;
  12.       
  13.       public var document:Object;
  14.       
  15.       public var type:Class;
  16.       
  17.       public var propertiesFactory:Function;
  18.       
  19.       private var _properties:Object;
  20.       
  21.       public var id:String;
  22.       
  23.       public function ComponentDescriptor(param1:Object)
  24.       {
  25.          var _loc2_:String = null;
  26.          super();
  27.          for(_loc2_ in param1)
  28.          {
  29.             this[_loc2_] = param1[_loc2_];
  30.          }
  31.       }
  32.       
  33.       public function toString() : String
  34.       {
  35.          return "ComponentDescriptor_" + id;
  36.       }
  37.       
  38.       public function invalidateProperties() : void
  39.       {
  40.          _properties = null;
  41.       }
  42.       
  43.       public function get properties() : Object
  44.       {
  45.          var _loc1_:Array = null;
  46.          var _loc2_:int = 0;
  47.          var _loc3_:int = 0;
  48.          if(_properties)
  49.          {
  50.             return _properties;
  51.          }
  52.          if(propertiesFactory != null)
  53.          {
  54.             _properties = propertiesFactory.call(document);
  55.          }
  56.          if(_properties)
  57.          {
  58.             _loc1_ = _properties.childDescriptors;
  59.             if(_loc1_)
  60.             {
  61.                _loc2_ = int(_loc1_.length);
  62.                _loc3_ = 0;
  63.                while(_loc3_ < _loc2_)
  64.                {
  65.                   _loc1_[_loc3_].document = document;
  66.                   _loc3_++;
  67.                }
  68.             }
  69.          }
  70.          else
  71.          {
  72.             _properties = {};
  73.          }
  74.          return _properties;
  75.       }
  76.    }
  77. }
  78.