Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [Request / Listing] Saving game in flash  (Read 1516 times)

0 Members and 1 Guest are viewing this topic.
[Request / Listing] Saving game in flash
« on: May 14, 2006, 01:18:43 pm »
  • Oh.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 579
No idea how to do it.   :D
« Last Edit: February 24, 2012, 07:03:18 pm by Niek »
Logged
Hm.
Re: Saving game in flash
« Reply #1 on: May 14, 2006, 03:34:16 pm »
  • Its the joeshmo!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 694
This is a tough one. What you want to do is set a cookie. Cookies are easy to set in flash. What you want to do is put the main variables inside the cookie, health, level, position on map, what quests are done, ect.

Here is how to set a cookie:

Quote
    cookie = SharedObject.getLocal("mycookie");
// of course you can replace mycookie with whatever you want
cookie.data.var1 = "Variable one";
//you must use the same variable name, in my case it is cookie, declared on line 1
 cookie.data.var2 = "Variable Two";
 cookie.data.var3 = "Variable Three";
 cookie.flush()
//frees up some memory. Not really needed, it just should be there.

You can have as many variables as you want in a cookie. Up to about 10mb I believe, thats around 3000 variables.
To set the variables its just
Code: [Select]
cookievariable.data.variablename= "variable value";Now to load the values its this:
Code: [Select]
cookie = SharedObject.getLocal("legacy");
var1 = cookie.data.var1;
var2= cookie.data.var2;
var3 = cookie.data.var3;

And thats that!


Logged
  • Netterra Virtual Pets
Re: Saving game in flash
« Reply #2 on: May 15, 2006, 11:38:07 am »
  • Oh.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 579
Wow!  I didn't realize it was that easy  ;D  Thanks again, you really know what your doing..  I only started Flash about 2 months ago and don't have much time  :'(
Logged
Hm.
Re: Saving game in flash
« Reply #3 on: May 15, 2006, 11:45:11 am »
  • Its the joeshmo!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 694
No problem. I have been doing flash for a year and a half. I recently switched to php, I am a better web designer than flash codist. Flash is a great program, its fast and powerful at the same time. It has a nice coding system. And it is much esier than C++.
Logged
  • Netterra Virtual Pets
Re: Saving game in flash
« Reply #4 on: May 16, 2006, 11:18:13 am »
  • Oh.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 579
Your a real help to me!  Thanks, again!  Ima try a savegame test :P
W00T IT WORKED!  Joeshmo, I declare you teh bestest.
« Last Edit: May 16, 2006, 11:36:12 am by Downsider »
Logged
Hm.
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.038 seconds with 44 queries.

anything