OK, I've used Save/load codes from tutorials, AS:main, etc. AND NONE WORK.
So, if someone can give me a 100% surefire code--I'll need it!!!!
One for a save button and a load button.
OK, I've used Save/load codes from tutorials, AS:main, etc. AND NONE WORK.
So, if someone can give me a 100% surefire code--I'll need it!!!!
One for a save button and a load button.
The code given in the AS: Main save/load tutorial is 100% function and teaches it VERY well.
I'm not sure what else you can possibly want.
At 7/27/06 11:23 PM, GamesCool wrote: The code given in the AS: Main save/load tutorial is 100% functional and teaches it VERY well.
I'm not sure what else you can possibly want.
It doesn't work. What am I doing wrong?
On load button:
on (press) {
var savefile = SharedObject.getLocal("savefile");
if (savefile.data.score == undefined) {
_root.score = 0;
_root.level = 0;
} else {
_root.score = savefile.data.score;
_root.level = savefile.data.level;
}
}
On save button:
on (press){
savefile.data.score=_root.score;
savefile.data.level=_root.level_mc;
savefile.flush();
}
Ummm... I press the save button, refresh the page, press the load button, and nothing happens.
OK. Here's the code I would use to test it, because the values you're getting might be wrong.
on (press) {
savefile = SharedObject.getLocal("savefile");
_root.tempscore = savefile.data.score;
_root.templevel = savefile.data.level;
trace("score is: " + _root.tempscore " and level is: " + _root.templevel);
}
On save button:
on (press){
savefile = SharedObject.getLocal("savefile");
savefile.data.score=50;
savefile.data.level=_12;
savefile.flush();
}
Whoops. My bad.
Change savefile.data.level=_12; to savefile.data.level=12;
Oof. I've got a good feeling 'bout this... but...
**Error** Scene=Scene 1, layer=Layer 15, frame=2:Line 5: ')' or ',' expected
trace("score is: " + _root.tempscore " and level is: " + _root.templevel);
**Error** Scene=Scene 1, layer=Layer 15, frame=2:Line 6: Unexpected '}' encountered
}
Total ActionScript Errors: 2 Reported Errors: 2
Whoops.
My bad.
Make it: trace("score is: " + _root.tempscore + " and level is: " + _root.templevel);
oh if it dosent work changer you flash player settings whoo