Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-03-2011, 01:46 AM   #1
werl
Registered User
 
Join Date: Dec 2010
Posts: 10
Default [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.
werl is offline   Reply With Quote
Old 01-03-2011, 07:21 AM   #2
zyxstand
Platinum Member
 
Join Date: Dec 2010
Posts: 193
Default

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.
zyxstand is offline   Reply With Quote
Old 01-03-2011, 10:14 PM   #3
werl
Registered User
 
Join Date: Dec 2010
Posts: 10
Default

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.
werl is offline   Reply With Quote
Old 01-05-2011, 04:45 PM   #4
rrh
throw a trace() in there
 
Join Date: Dec 2006
Posts: 1,982
Default

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?
rrh is offline   Reply With Quote
Old 01-05-2011, 10:40 PM   #5
werl
Registered User
 
Join Date: Dec 2010
Posts: 10
Default

Yes.

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:

Code:
var foodland:int;
function funct1(Event:MouseEvent):void{
	foodland ++;
	this.play();
}
and then the following is on the mc

Code:
this.addEventListener(MouseEvent.CLICK, funct1);
werl is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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. The time now is 07:07 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.