3 Replies Latest reply on Jun 13, 2011 8:19 AM by Flex harUI

    argument count mismatch error: Expected 1, got 0.

    flexnewbie2011

      I am writing a datagridcolumn array to the cookie, and upon retreiving the user data it immediately throws "argument count mismatch error: Expected 1, got 0" on MediaGridColumnInfo(). I assume there is a disconnect between what I am saving and what is expected to receive.

       

      this is how I am saving the array:

       

      public function Save():void
              {
                  user.data.MediaListGridColumnsArray = new MediaGridColumnInfo(this.datagrid.columns);
                  user.flush();
              }

       

      when I put a trace on user.data.MediaListGridColumnsArray.columnObject after saving, it shows the correct type [object datagridcolumn].

       

      This is the entire MediaGridColumnInfo class (got this from another thread for solving storing typed object issue):

       

      package digitalmedia.components.entities
      {
          import flash.display.Sprite;
          import flash.events.*;
          import flash.net.SharedObject;
          import flash.net.registerClassAlias;
          import flash.utils.IDataInput;
          import flash.utils.IDataOutput;
          import flash.utils.IExternalizable;
             
          public class MediaGridColumnInfo implements IExternalizable 
          {
              public var columnObject: Array;
             
              public function MediaGridColumnInfo(columnObject: Array)
              {
                  this.columnObject = columnObject;
              }
             
              public function writeExternal(output:IDataOutput):void
              {
                  output.writeObject(columnObject);
              }
             
              public function readExternal(input:IDataInput):void
              {
                  columnObject = input.readObject();
              }
          }
      }

       

      any ideas? thanks