Go Back   kirupaForum > Flash > ActionScript 1.0/2.0

Reply
 
Thread Tools Display Modes
Old 09-07-2009, 11:23 AM   #1
chris_1344
Registered User
Remembering variables after the application is closed?

Hi all,

I have attached the .fla that I am working on. I understand that it is very basic and does not use class files and so on.... but I am just applying the finishing touches so that it actually works.

Inside the quiz movieclip is some code that makes people's names and scores be entered onto the leaderboard. This works perfectly fine, however when I close the SWF and take the quiz again, the people that were previously on the leaderboard have disapeared!

Is there anyway to make the best people stay on the leaderboard for future uses?

Like I have said, I have attached the .fla but the code that is in question is:

From frame 65 of quiz:

Code:
 
Mouse.show();
finishTime = minutes+":"+seconds+":"+hundredths;
userName.text = username+" completed the quiz in "+finishTime;
userEmail.text = useremail;
/*var leaderboardArray:Array = new Array();
leaderboardArray.push(username, finishTime);*/
view_leader.label = "Leaderboard";
view_leader.onRelease = function() {
 gotoAndStop('leaderboard');
 yourname_txt.value = username;
 yourtime_txt.value = finishTime;
};
Then after the button is pressed, from Frame 70:

Code:
this.onEnterFrame = function() {
 if (yourtime_txt.text<pos1time_txt.text) {
  pos2time_txt.text = pos1time_txt.text;
  pos2_txt.text = pos1_txt.text;
  pos1time_txt.text = yourtime_txt.text;
  postxt.text = yourname_txt.text;
 } else {
  pos2time_txt.text = yourtime_txt.text;
  pos2_txt.text = yourname_txt.text;
 }
};
HELP!!! Thanks!

** FLA not attached as it is too large of a file size** Sorry

Last edited by chris_1344; 09-07-2009 at 11:26 AM.. Reason: Could not attach .fla due to file size
chris_1344 is offline   Reply With Quote

Sponsored Links (Guests Only) - Register | Need Help?
 

Old 09-07-2009, 11:30 AM   #2
glosrfc
Registered User
 
glosrfc's Avatar
Location Halley Research Station, Latitude 75°35' S, Longitude 26°39' W, Brunt Ice Shelf, Coats Land, Antarctica

Posts 4,158
Check out Shared Object in the help files and also on this site as there are loads of examples. This can be used to save a user's scores, name, etc. on a single PC.
http://www.kirupa.com/developer/acti...ed_objects.htm

If you want to keep a leaderboard for other remote users, you will have to use a client-side script, e.g. PHP.

__________________
©2006 GlosRFC - Searching 8,168,684,336 brain cells
glosrfc is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:19 PM.

SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
Creative web apps. Make your own free flash banners and photo slideshows.
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.

Flash Transition Effects

Flash Effect Tutorials

Digicrafts Components
Flash effects. Art without coding. Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com
Streamsolutions Content Delivery Networks Flipping Book - page flip flash component.
Flash-Gallery.com - Get your flash photo gallery (flash component or swf gallery Learn how to advertise on kirupa.com
 

cdn
content delivery network (cdn)

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Copyright 2010 - kirupa.com Copyright 2010 - kirupa.com