Moving an swf, Data, SharedObject, and SharedObject.localPath


(Jacob) #1

Hello. Thank you in advance for any help.

I’m making a block pushing puzzle game (pics) and the data needed for the game to build a puzzle are saved in SharedObjects via FlashPunk’s Data class. I would like to send the game to some friends so they could help with testing but the game doesn’t load any of the puzzles if I move the swf.

I’ve read through several things like the Data class, SharedObject class, [SOLVED] My flashgame on FGL loses its savedata. Need help creating robust saving system, The Trick to Using SharedObject. However, I’m still confused as to how I would get Data or SharedObject to look down the correct or different file path if I move the swf. I keep thinking I could somehow save the SharedObjects in the bin folder and then somehow tell Data to access it from there but I’m not sure how and don’t see anything in Data that would do that.


(Jacob Albano) #2

To be clear; are you creating the levels within the swf, then saving them as SharedObjects to load them later? As far as I know there isn’t a way to transfer SOs from one computer to another – I don’t even know where Adobe stashes them, and I’ve done a fair amount of searching.

I would recommend using a file format like XML to store your level data in, then creating the built-in levels from embedded files.


(Jacob) #3

Jacob, thanks for the help.

Yes, I’ve been creating the puzzles within the swf through a Room Designer feature where the user can simply pick a tile or block type then click and drag. Clicking the ‘ADD ROOM’ button saves the design as a SharedObject.

c:/Users/username/AppData/Roaming/Macromedia/Flash Player/#SharedObjects is where Adobe stashes SharedObjects but I’m hoping to move them to a different location (like the bin folder maybe?). That way I could just send the bin folder to a friend to have them do testing.

Given this information, do you think your XML/embedded files suggestion would be the best route? If so, do you know of something I could read up on to become familiar with the process? So far, I’ve only learned how to save data through FlashPunk’s Data class.

Thanks again.


(Zachary Lewis) #4

SharedObjects aren’t really the kind of thing you use for game content. They’re great for saving little bits of stuff (the player has unlocked level 14, the player’s highest score is 300 points, the player’s name is Chevy, et cetera), but you definitely want an easy way to create and manipulate your game content.

I’d recommend setting up Ogmo to create your levels. If you’re not sure how to use it, here’s a tutorial I made showing how to create levels with it.


(Jacob) #5

Zach, thanks for the help. I’ll check out Ogmo.