I recently purchased CS4 and am trying to publish some older files with no changes to them and am having the following problem.
I want to place a SharedObject on the local machine. The idea is this. Students take a quiz once. When they try to take the quiz twice and they are sent to a frame telling them they can't.
I used this code with Flash MX 2004
PHP Code:
my_so = SharedObject.getLocal("myCookie");
if (my_so.data.lock445556789) {
gotoAndPlay("locked");
}
my_so.data.lock445556789 = true;
my_so.flush();
When I publish those files as projector files (player 6, actionscript 1) in CS4 they work fine.
I used the same code in Flash 8 (player 8, actionscript 2). The code worked fine when published with flash 8 but no longer works when the same files are published in CS4. (Everything else works fine)
I tried updating just that snippet of code to this.
PHP Code:
var mySharedObject:SharedObject = SharedObject.getLocal("myCookie");
if (mySharedObject.data.skipQuiz == "12345") {
gotoAndPlay("locked");
} else {
play();
}
mySharedObject.data.skipQuiz = "12345";
mySharedObject.flush();
The files work when published as SWF but not when they are published as projector files. I would appreciate any suggestions.