5

I just need to know how to save my mobile AIR game levels on local machine. Like all the details should be get save eg. how much level i finished or opened once and played, those levels should be in unlocked state. If the level which was never open before will be in locked state. This is my concept and this is the concept used in all mobile games nowadays. kindly please go through any mobile game level type and please let me know the coding for my concept its very urgent. And Thanks in advance. Any help will be kindly appreciatable.

The code which i used is below: Flash AS3

var file = File.applicationStorageDirectory.resolvePath("test.txt"); 
var str = "Locked Levels : Level 1,Level 2,Level 3,Level 4"; 
file.addEventListener(Event.COMPLETE, fileSaved); 
file.save(str); 
function fileSaved(event) 
{ 
    trace("Done."); 
}

In the above code the text document is getting write to my local machine. But i don't know how to check the levels which are locked are unlocked using this . i kept my level buttons on stage itself by using frames for lock and unlock position. Thanks in advance.

4

2 に答える 2

3
  1. AdobeAIRに組み込まれているSQLite機能を使用できます。このために、後でクエリできるローカルデータベースを作成できます。

また

  1. データを独自の形式でapplicationstoragefolderに保存して、後で読み取って解釈できるようにします。

個人的には、暗号化されたSQLiteを使用するので、「悪意のある」人による「ハッキング」スコアから抜け出すことができます:)

于 2012-06-13T11:07:11.770 に答える
2

Here you will find some infos about working with SQL in AIR: http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118676a5497-7fb4.html

And here you will find a tutorial: http://kirill-poletaev.blogspot.de/2011/05/creating-air-application-with-sqlite.html

于 2012-06-13T11:29:28.620 に答える