ShareObject
  • یک کلاس آبجکت کاملا قدرتمند برای ذخیره داده ها ما بین کاربران یک کامپیوتر ...
  • توضیحات کلی درباره با خصوصیات و روالهای این کلاس

    - Methods :
    SharedObject.clear() : Purges all of the data from the shared object and deletes the shared object from the disk.
    SharedObject.flush() : Immediately writes a locally persistent shared object to a local file.
    SharedObject.getLocal() : Returns a reference to a locally persistent shared object that is available only to the current client.
    SharedObject.getSize(): Gets the current size of the shared object, in bytes.

    - Properties (read-only) :
    SharedObject.data : The collection of attributes assigned to the data property of the object; these attributes can be shared and/or stored.

    - Event handler :
    SharedObject.onStatus : Invoked every time an error, warning, or informational note is posted for a shared object.
  • روش استفاده از کلاس

    // لود کردن داده ها از فایل محلی در یک متغییر
    var shr_obj:SharedObject = SharedObject.getLocal( 'shr_obj_test' );

    // چک می کنیم که آیا داده ای ذخیره شده است
    if (shr_obj.data.stored != undefined) {
    trace( 'Data found and loaded ...' );
    } else {
    trace( 'Data not found ...' );
    }

    // ذخیره ی یک داده در فایل محلی
    shr_obj.data.stored = 'ok, stored';
    shr_obj.flush();
  • لینک دانلود مثال : روش استفاده از کلاس ( ذخیره یک نوشته )


یا حق ...