Why isn't my game saving on kong?

Subscribe to Why isn't my game saving on kong? 3 posts

avatar for BraydenBlack BraydenBlack 271 posts
Flag Post

When i test my game locally, everything saves fine. But when i upload the game to kongregate, the game doesn’t save, is there something else i should be doing? And can someone test this themselves? (F & F) The game auto-saves.

This is how im saving.


var saveFile:SharedObject;

function checkSaveFile():void { // First function called in the game
	saveFile = SharedObject.getLocal("FFsave");
	if(saveFile != null) {
		curLevel = saveFile.data.curLevel;
		if(saveFile.data.curAttempts>1) curAttempts = saveFile.data.curAttempts-1;
		if(curLevel > 3) { //saveFile has completed tutorial levels
			option1Enabled = true;
			showTutorial = false;
		}
	} else saveGame();
}

function saveGame():void { //saves curren level and attempts to saveFile
	saveFile.data.curLevel = curLevel;
	saveFile.data.curAttempts = curAttempts;
	saveFile.flush();
}

And the saveGame() function is being called regularily throughout the game whenever the player completes a level/dies or beats the game.

Thanks to anyone who helps!

 
avatar for Senekis93 Senekis93 4090 posts
Flag Post

It worked for me; after finishing the first level and refreshing the page, it loaded level 2. Maybe your browser deletes shared objects after sesion is over?

 
avatar for BraydenBlack BraydenBlack 271 posts
Flag Post

Ahhh… x.x thanks senekis… :P Now i feel stupid haha.