View Full Version : [AS3] saving a map to reload later 2d array
I have a game where you build stuff onto a grid and I need to be able to save and load the grid. All points are movcieclips and will have quite a few different frames.
Thanks, if you need any more info don't hesitate to ask.
01-03-2011, 08:21 AM
you can't save things to the hard drive with flash. you can create cookie-like things called sharedobject (you can look into that).
if you need it temporarily or something, what you could do is have the program spit out some formatted text that you can copy and save somewhere, and next time you run your flash file you can either just paste it or url-load it.
there are plenty of sharedobject tutorials out there if you wanna do that. note that these "cookies" are not 100% reliable. they will be cleared when you clear your cache for instance.
This is to be kept inside the running file, the big thing is to set it up so that when you go to another frame then come back it will be the same.
Oh, then the big issue isn't where you're storing the data: you're just sticking it in variables. The big issue is how to organize and process all that data.
So you're saying what you need to store for each movieclip is x, y and frame?
I have a new different problem, when I click on a movieclip I need to add 1 to a var, but bore some reason it's not working. This code is in an .as file and everything else is working fine. Here is the code:
and then the following is on the mc
vBulletin® v3.8.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.