having trouble with flash shared objects.
i want the SO to remember the last frame the user visited.
both are stop frames that can only be reached by button navigation. here is my code so far:
//first frame of movie. no SO = play. SO present = go to last frame
so = sharedobject.getlocal(“lastframe”);
if (so.data.frame == undefined){
play();
} else {
this.gotoAndStop(so.data.frame);
}
//here is the code for the last frame visited
//again, this code is only on two frames
stop();
function rememberme() {
so.data.frame = this._currentFrame;
}
thanks!
ill have to try that tonight.
i will let you know how it works.
*but the point is so the when the user returns to the movie, the last frame they visted in the movie will now be the first.
this will be stored localy via the shared object.
it looks like i have trouble saving the frame the user was last on.
the second part of the script goes on each frame you want to be remembered. that way it records the frame number last viewed to the correct data field in the shared object to be retrieved on the next visit.
i tested on my server. all shared objects work via a domain name for storing and calling the SO.
// try to keep ur codes on a separate layer for example: (scripts)
//then on the frame than u need to record the possition off, the
//ones you said you can only reach by navigation, use this code.
so.data.frame = _currentframe;
stop();
// place the stop() after the code, this might be ur mistace.
// or it might be the fact that u wrote a function and did not call it
//when u write functions and u need to use them , like u did, u
//have to use a function call, see more in the flash help.
no problem.
keep in mind that once it works, ur moviw will start in the frame that u visited last , so if your navigation button does not allow u to get to the first frame again, then you will not be able to do so unless you find the lastframe.as, in ur system and delete it. i mean with lastframe.as, the file into wich the sharedobjects are stored, this is created by the flash player.