Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shared Objects

Status
Not open for further replies.

tallgiant

Technical User
Aug 4, 2004
10
US
I need to create a CD for a class project. The CD contains a series of information and short quizes. When a user logs into the .swf file, the .swf file should remember where the person last left off within the .swf (if they have logged in before). Someone said to use shared objects, but I have not seen any good demos on how to do this (writing the code and where to place the code for shared objects). Any ideas, demos, or links? Thanks!
 
Here's some example code:

Code:
my_so = SharedObject.getLocal('myCookie');
my_so.data.seenIntro = true;
my_so.flush();

Since you don't know how the user will exit the program, I suggest re-writing or updating the .sol file each time they go to a new page. To do this, put the code as an action on the frame, with an identifier to say where they are in the program.

In the first frame, when the movie is loaded, put in some script to detect the .sol file, if it exists:

Code:
my_so = SharedObject.getLocal('myCookie');
if (my_so.data.seenIntro) {
	gotoAndPlay('post_intro');
}

Hope this helps. Good luck!

Tigerjade

"Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live." -- Martin Golding


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top