Hey
What is the best way to load and store data? I've been using Embeds for sprite graphics, tilemaps and sounds, and they're easy, they're fast and no problems with them... apart from flexibility:
public class Level1 extends LevelBase
{
[Embed(source = "../../assets/mapCSV_Level1_Sky.csv", mimeType = "application/octet-stream")] public var skyCSV:Class;
[Embed(source = "../../assets/mapCSV_Level1_Map.csv", mimeType = "application/octet-stream")] public var mapCSV:Class;
[Embed(source = "../../assets/backdrop.png")] public var skyTilesPNG:Class;
[Embed(source = "../../assets/tiles.png")] public var mapTilesPNG:Class;
[Embed(source = "../../assets/levels/level1_path1.txt", mimeType = "application/octet-stream")] public var paths:Class;
[Embed(source = "../../assets/levels/level1.xml", mimeType = "application/octet-stream")] public var enemy_zones:Class;
I'd rather define level name in base class, that would be prepended with all assets names, ie.
var level_name : String;
level_name = "level1";
var base_path : String = "../../assets/";
LoadSomeResource( base_path + level_name + ".xml"); // pseudo-code
LoadOtherResource( base_path + level_name + "_path.txt");
I could to that with loaders, either Adobe or GreenSock flavours, but there's one thing that bothers me: how to create single .swf file that can be distributed without any references on directories. Embeds are good in that they automatically are embedded in the final swf.
Is there any system that takes all the dynamic assets you want and packages them to swf? Perhaps LoaderMax can perform such a feat? Sorry I'm new to flash platform, and my google fu didn't help with this
What I'm aiming at, is a flash Flixel game that can be distributed globally and sold to FGL. I heard it has to be delivered as a single swf file. Fair enough. Is going with Embeds the only way? I'm using latest FlashDevelop.