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

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

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
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
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
this object. The default value is 0.
):
- An integer specifying the number of bytes that must be allotted for
(for the complete example,
my_so
SharedObject
flush()
589

Advertisement

Table of Contents
loading

Table of Contents