PDA

View Full Version : Problems with a quiz...


cowboymannen
01-19-2005, 10:28 AM
Hi

I'm making a little quiz and having a problem...

If the user leaves the page and comes back another time, I wan't the swf to jump to the question where he stopped. I have a textfields with the same variable (framenr) through the whole movie, and a cookie is set via a php file. The frame number for the specific question is set in the textfield...
Now I wan't the swf to jump to that specific textfield as soon the user gets back, but I can't figure out how to do... hmm...

Hope you understand what I mean....

I have tried somehing like this:

if (framenr)
{
if (framenr){
gotoAndPlay(framenr);

}else{
gotoAndPlay(7);
}
}else {
stop();
}

.... but suppose you need something more....

Hope someone can help me!
Thanks.

baigorri
01-19-2005, 03:01 PM
This is straight from the macromedia help docs

// Get the kookie
so = sharedobject.getlocal("kookie");

// Get the user of the kookie and go to the frame number saved for this user.
if (so.data.user != undefined) {
this.user = so.data.user;
this.gotoAndStop(so.data.frame);
}

The following code block is placed on each SWF frame.

// On each frame, call the rememberme function to save the frame number.
function rememberme() {
so.data.frame=this._currentFrame;
so.data.user="John";
}