Storing Permanent Data Without Filesystem

I’ve been looking into a way to store my 2D array tilemap data into a permanent file. The problem is, that the Flash and Javascript targets do not support Haxe’s FileSystem library. Is there another way that I could store my data, that would work with all of the targets (Or at least Flash and Javascript)?

Thanks for any help.

js/flash are restricted from accessing the local file system (flash could have access to it under certain circumstances, e.g. explicitly granted by user).

if you want, from your app, to store stuff on the player machine, then you may want to look into flash.net.SharedObject. it’s not the same as a file, more like a cookie type of thing.

if you just want to load app assets, then this might help: https://openfl.fandom.com/wiki/Asset_Management

I’ll have to have 2 implementations then, right? One with SharedObject (Flash) and one with FileSystem (Other platforms)

Thanks for the quick reply.

OpenFL implements SharedObject on all platforms, so no need for different implementations.

if you’re trying to save/share player-made content, you may also look into cloud-based solutions, like https://gamejolt.com/game-api

you might wanna check this > https://github.com/ciscoheat/haxelow.

in the browser, or for Sys targets: It works straight out-of-the-box.

What, no… if you just want to load 2D array tilemaps you should use Assets like Karg suggested.