so I’m making a rhythm game where the players can create custom maps and add custom songs (json, mp3, png for background), but i don’t know how to load files which weren’t present during the build.
https://api.openfl.org/openfl/net/URLLoader.html This API embodies one cross platform solution.
does it also work with local files?
For local files you can use
ByteArray.loadFromFile() which in the background is similar to URLLoader’s logic, or if you’re not using HTML/JS or Flash, Haxe’s File.getBytes(). Whichever suits your needs, there are several methods to achieve the same results.
I recommend async loading of data for multiple reasons even in desktop/mobile apps.
Yes, it works for local the local filesystem as well.