all groups > flash actionscript > september 2004 >
You're in the

flash actionscript

group:

Saving Locally with Flash



Saving Locally with Flash jthereliable
9/26/2004 4:13:45 PM
flash actionscript: Let's put it this way, I'm making a game, like an RPG or adventure game. I want
to allow the player to save his character on their computer. I came across this
code but really don't understand what it does... (attached code)

and i came across this code: MMSave(this,"/guy.swf");

Can anyone explain what they do or write me a code on how to do this saving
thing.

Thanks in Advance

--A kid in need...

//create a new movieclipthis.createEmptyMovieClip("holder",1);//load
Macromedia's site navigation into that
movieclipholder.loadMovie("http://www.macromedia.com/uber/nav/global_home.swf");
//check to see if the movie has fully loaded//before outputting the local
filethis.onEnterFrame=function(){ if(holder.getBytesLoaded() ==
holder.getBytesTotal()){ //save the movie loaded into the holder
movieclip //as macromedia_navigation.swf in the Configuration
//directory on the local computer
MMSave(holder,"macromedia_navigation.swf"); //stop checking to see if
the movie has fully loaded delete this.onEnterFrame; }};
Re: Saving Locally with Flash talltyler
9/26/2004 4:26:18 PM
flash cant save files like you are wanting. director can or if on the internet
you can save file on a server with php or other server scripting thing. There
maybe things I dont know about but this is what I know.
Re: Saving Locally with Flash jthereliable
9/26/2004 4:41:29 PM
Umm...

Re: Saving Locally with Flash _jrh_
9/26/2004 5:48:43 PM
Re: Saving Locally with Flash jthereliable
9/29/2004 9:04:19 PM
Re: Saving Locally with Flash _jrh_
9/29/2004 10:03:36 PM
Here's a very basic flash cookie:

cookie_so = sharedObject.getLocal("playerdata"); // creates (or reads) the
"playerdata" shared object
cookie_so.data.score = 1200; // writes score data to cookie
cookie_so.flush(); // saves cookie

To read it, you do the exact same thing:
cookie_so = sharedObject.getLocal("playerdata");
highscore_txt.text = cookie_so.data.score;

You always need to have ".data" before the variable you want to store in the
object.

Hope that helps!
Re: Saving Locally with Flash jthereliable
9/30/2004 3:30:57 PM
TYVM

This'll make my game much better now that I can save stuff.

One last question though, when saving cookie, do I have to save every single
variable seperately? Is there a way to speed it up or something?
Re: Saving Locally with Flash _jrh_
9/30/2004 3:39:02 PM
If you keep the variable stored in an array or object, you can just save that.

Re: Saving Locally with Flash jthereliable
9/30/2004 7:24:11 PM
AddThis Social Bookmark Button