Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 Flash AS3,为iOs和android游戏保存和加载数据_Actionscript 3_Flash - Fatal编程技术网

Actionscript 3 Flash AS3,为iOs和android游戏保存和加载数据

Actionscript 3 Flash AS3,为iOs和android游戏保存和加载数据,actionscript-3,flash,Actionscript 3,Flash,我正在尝试为iOS和Android制作游戏。如何将数据保存到小工具,以及如何加载它?我想保存到用户设备的数据基本上只是一堆字符串。请帮忙 顺便说一句,我在游戏中使用Flash CS6。SharedObject类应该适合您。您写入/读取的属性可以是任何类型(字符串、数组、数字、布尔值、XML等) 基本示例: var scores : Array = new Array(10, 20, 30); var my_so : SharedObject = S

我正在尝试为iOS和Android制作游戏。如何将数据保存到小工具,以及如何加载它?我想保存到用户设备的数据基本上只是一堆字符串。请帮忙


顺便说一句,我在游戏中使用Flash CS6。

SharedObject类应该适合您。您写入/读取的属性可以是任何类型(字符串、数组、数字、布尔值、XML等)

基本示例:

        var scores : Array        = new Array(10, 20, 30);
        var my_so  : SharedObject = SharedObject.getLocal("myGameHighscore");
        my_so.data.scores         = scores; // set scores var to data object of SharedObject
        my_so.flush();            // writes the data instantly

        // To retreive your scores simply use getLocal again and then do something like:
        trace(my_so.data.scores[0]); // will trace first element of scores array "10"
请参阅以下网址: