EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Flush (Sharedobject.flush Method)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SharedObject 589
The shared object contains the following data:
favoriteSong: My World is Blue
favoriteNightClub: The Bluenote Tavern
favoriteColor: blue
data: [object Object]
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example saves text to a shared object named
my_so (for the complete example,
see
SharedObject.getLocal()):
var my_so:SharedObject = SharedObject.getLocal("savedText");
// myText is an input text field and inputText is a dynamic text field.
myText.text = my_so.data.myTextSaved;
// Assign an empty string to myText_ti if the shared object is undefined
// to prevent the text input box from displaying "undefined" when
// this script is first run.
if (myText.text == "undefined") {
myText.text = "";
}
changedListener = new Object();
changedListener.onChanged = function (changedField) {
my_so.data.myTextSaved = changedField.text;
inputText.text = "";
inputText.text = my_so.data.myTextSaved;
}
myText.addListener(changedListener);
flush (SharedObject.flush method)
public flush(minDiskSpace:Number) : Object
Writes shared object to a local, persistent file. To guarantee that the shared object will be
written to the device, the application must force a write operation by calling the
flush()
method.
Unlike in Flash Player, the write operation is asynchronous and the result is not immediately
available.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
minDiskSpace:Number - An integer specifying the number of bytes that must be allotted for
this object. The default value is 0.

Table of Contents

Related product manuals