Packagecom.ericfeminella.local
Classpublic class LocalPersistence
ImplementsIAMFEncodable, IFlexUISession, IManagedPersistence

Provides an API which allows local persistence to be maintaining on the client via SharedObject



Public Properties
 PropertyDefined by
  objectEncoding : int
Sets the current ObjectEncoding version of the persisted object
LocalPersistence
Protected Properties
 PropertyDefined by
  identifier : String
The name of the SharedObject instance used for local persistence
LocalPersistence
  lso : SharedObject
SharedObject instance which persists data locally on the client
LocalPersistence
Public Methods
 MethodDefined by
  
LocalPersistence(identifier:String, minDiskSpace:int = 100)
Creates a reference to the persisted SharedObject available from the clients local-disk.
LocalPersistence
  
Deletes all properties from the persisted object
LocalPersistence
  
deletePersistedProperty(propertyName:String):Boolean
Deletes a specified property from the persisted object
LocalPersistence
  
destroy():void
Destroys the current SharedObject from the clients local disk
LocalPersistence
  
Returns the current session date of a persisted object
LocalPersistence
  
Retrieves the current session timestamp
LocalPersistence
  
getData():Object
Returns the data object of the persisted object.
LocalPersistence
  
getIdentifier():String
Returns the name of the shared object.
LocalPersistence
  
Returns an array of all properties in the persisted object
LocalPersistence
  
getPersistedProperty(propertyName:String):*
Returns the value of a specified persisted property
LocalPersistence
  
Returns the previous session date of a persisted object
LocalPersistence
  
Retrieves the previous session timestamp
LocalPersistence
  
getSessions():Array
Retrieves all session unique identifier
LocalPersistence
  
Retrieves all session timestamps
LocalPersistence
  
getSize():int
Returns the size object of the persisted object.
LocalPersistence
  
setPersistedProperty(propertyName:String, value:* = null):void
Sets the value of a specified persisted property
LocalPersistence
  
write(minDiskSpace:int = 100):Boolean
Writes the persisted SharedObject to disk
LocalPersistence
Property detail
identifierproperty
protected var identifier:String

The name of the SharedObject instance used for local persistence

lsoproperty 
protected var lso:SharedObject

SharedObject instance which persists data locally on the client

objectEncodingproperty 
objectEncoding:int  [read-write]

Sets the current ObjectEncoding version of the persisted object

Implementation
    public function get objectEncoding():int
    public function set objectEncoding(value:int):void
Constructor detail
LocalPersistence()constructor
public function LocalPersistence(identifier:String, minDiskSpace:int = 100)

Creates a reference to the persisted SharedObject available from the clients local-disk. If the SharedObject does not currently exsist, Flash Player will attempt to created it

If the identifier contains any invalid charachters, they will be substituted with underscores

Parameters
identifier:String — name of the local shared object
 
minDiskSpace:int (default = 100) — minimum amount of disc space required by the shared object
Method detail
deletePersistedProperties()method
public function deletePersistedProperties():Boolean

Deletes all properties from the persisted object

Returns
Boolean — true if the properties have successfully been deleted
deletePersistedProperty()method 
public function deletePersistedProperty(propertyName:String):Boolean

Deletes a specified property from the persisted object

Parameters
propertyName:String — name of the property to delete

Returns
Boolean
destroy()method 
public function destroy():void

Destroys the current SharedObject from the clients local disk

getCurrentSessionId()method 
public function getCurrentSessionId():Number

Returns the current session date of a persisted object

Returns
Number — a date object for the current session
getCurrentSessionTimestamp()method 
public function getCurrentSessionTimestamp():String

Retrieves the current session timestamp

Returns
String — the current session timestamp
getData()method 
public function getData():Object

Returns the data object of the persisted object. The data object is a property of SharedObject and is used to maintain persisted data either Locally or Remotely

Returns
Object — An object which contains all properties / values
getIdentifier()method 
public function getIdentifier():String

Returns the name of the shared object.

Returns
String — The name of the shared object
getPersistedProperties()method 
public function getPersistedProperties():Array

Returns an array of all properties in the persisted object

Returns
Array — an array of all persisted properties
getPersistedProperty()method 
public function getPersistedProperty(propertyName:String):*

Returns the value of a specified persisted property

Parameters
propertyName:String

Returns
* — the value of the property
getPreviousSessionId()method 
public function getPreviousSessionId():Number

Returns the previous session date of a persisted object

Returns
Number — a date object for the previous session
getPreviousSessionTimestamp()method 
public function getPreviousSessionTimestamp():String

Retrieves the previous session timestamp

Returns
String — the current session timestamp
getSessions()method 
public function getSessions():Array

Retrieves all session unique identifier

Returns
Array — an Array of all session identifiers
getSessionTimestamps()method 
public function getSessionTimestamps():Array

Retrieves all session timestamps

Returns
Array — an Array of all session identifiers
getSize()method 
public function getSize():int

Returns the size object of the persisted object.

Returns
int — the size of the LSO in kilobytes
setPersistedProperty()method 
public function setPersistedProperty(propertyName:String, value:* = null):void

Sets the value of a specified persisted property

Parameters
propertyName:String — name of the property to be persisted
 
value:* (default = null) — value of the property to be persisted
write()method 
public function write(minDiskSpace:int = 100):Boolean

Writes the persisted SharedObject to disk

Parameters
minDiskSpace:int (default = 100) — minimum amount of disc space required by the shared object

Returns
Boolean — true if the write operation was successful, false if not