![MACROMEDIA Flash Lite 2 Скачать руководство пользователя страница 589](http://html1.mh-extra.com/html/macromedia/flash-lite-2/flash-lite-2_reference_687553589.webp)
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.
Содержание Flash Lite 2
Страница 1: ...Flash Lite 2 x ActionScript Language Reference...
Страница 22: ...22 Contents...
Страница 244: ...244 ActionScript language elements...
Страница 760: ...760 ActionScript classes...