Cannot get this to work to save my life. Trying to be able to save the game. Right now, the money saves, but not the rest of the data. Here is what is going on: Click the penny, $10 is added to your score, the penny disappears. When I click save game, then exit and re open the game, I click load, and the penny is still there! The score is right, but WHY isn’t ALL the data being saved? In this case, why is the penny returning when I click Load but the score is right? Here is my code on the main timeline:
money = 0;
function Save():Void
{
_root.myData = SharedObject.getLocal("myData");
_root.myData.data.money = _root.money;
_root.myData.data.testPenny = _root.testPenny;
}
function Load():Void
{
_root.myData = SharedObject.getLocal("myData");
_root.money = _root.myData.data.money;
_root.testPenny = _root.myData.data.testPenny;
}
function Clear():Void
{
_root.myData.clear();
}