home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2012 April / ME_04_2012.iso / Video-Tutorial / iPhoto / media / player.swf / scripts / mx / collections / ArrayCollection.as next >
Encoding:
Text File  |  2011-11-11  |  1.4 KB  |  61 lines

  1. package mx.collections
  2. {
  3.    import flash.utils.IDataInput;
  4.    import flash.utils.IDataOutput;
  5.    import flash.utils.IExternalizable;
  6.    import mx.core.mx_internal;
  7.    
  8.    use namespace mx_internal;
  9.    
  10.    public class ArrayCollection extends ListCollectionView implements IExternalizable
  11.    {
  12.       mx_internal static const VERSION:String = "4.5.0.20967";
  13.       
  14.       public function ArrayCollection(param1:Array = null)
  15.       {
  16.          super();
  17.          this.source = param1;
  18.       }
  19.       
  20.       [Bindable("listChanged")]
  21.       public function get source() : Array
  22.       {
  23.          if(Boolean(list) && list is ArrayList)
  24.          {
  25.             return ArrayList(list).source;
  26.          }
  27.          return null;
  28.       }
  29.       
  30.       public function set source(param1:Array) : void
  31.       {
  32.          list = new ArrayList(param1);
  33.       }
  34.       
  35.       public function readExternal(param1:IDataInput) : void
  36.       {
  37.          if(list is IExternalizable)
  38.          {
  39.             IExternalizable(list).readExternal(param1);
  40.          }
  41.          else
  42.          {
  43.             this.source = param1.readObject() as Array;
  44.          }
  45.       }
  46.       
  47.       public function writeExternal(param1:IDataOutput) : void
  48.       {
  49.          if(list is IExternalizable)
  50.          {
  51.             IExternalizable(list).writeExternal(param1);
  52.          }
  53.          else
  54.          {
  55.             param1.writeObject(this.source);
  56.          }
  57.       }
  58.    }
  59. }
  60.  
  61.