03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

■ If the minimumDiskSpace parameter exceeds the maximum space available for a SWF file,<br />

or the remaining space available for a SWF file, or if there was an error processing the<br />

request, flush() returns false.<br />

If the flush() method returns pending, the Flash Lite player can show a dialog box asking<br />

the user to free up space to increase the amount of disk space available to shared objects. To<br />

allow space for the shared object to exp<strong>and</strong> when it is saved in the future, which avoids return<br />

values of pending , you can pass a value for minimumDiskSpace. When the Flash Lite player<br />

tries to write the file, it searches for the number of bytes passed to minimumDiskSpace,<br />

instead of searching for enough space to save the shared object at its current size.<br />

Example<br />

The following example h<strong>and</strong>les the possible return values for the flush() method:<br />

so_big = SharedObject.getLocal("large");<br />

so_big.data.name = "This is a long string of text.";<br />

so_big.flush();<br />

var flushResult = so_big.flush();<br />

switch (flushResult) {<br />

case 'pending' :<br />

result.text += "pending";<br />

break;<br />

case true :<br />

result.text += "Data was flushed.";<br />

break;<br />

case false :<br />

result.text += "Test failed. Data was not flushed.";<br />

break;<br />

}<br />

See also<br />

clear (SharedObject.clear method), onStatus (SharedObject.onStatus h<strong>and</strong>ler)<br />

getLocal (SharedObject.getLocal method)<br />

public static getLocal(name:String) : SharedObject<br />

Returns a reference to a locally persistent shared object that is available only to the current<br />

client. If the shared object does not already exist, getLocal() creates one. This method is a<br />

static method of the SharedObject class.<br />

Note: In Flash Lite, a shared object cannot be shared between two SWF files.<br />

To assign the object to a variable, use syntax like the following<br />

558 ActionScript classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!