I just need to know how to save levels of AIR mobile games on a local machine. Like all details, you need to get a save, for example. how many levels I finished or opened once and played, these levels should be in an unlocked state. If a level that has never been opened will be in a locked state. This is my concept, and this is the concept used in all mobile games these days. kindly go through any type of mobile game level and please let me know that the coding of my concept is very relevant. And thanks in advance. Any help would be kindly understood.
The code 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, a text document gets written to my local machine. But I do not know how to check levels that are locked, unlocked with this. I held the level buttons on the stage itself, using frames to lock and unlock. Thanks in advance.
source
share