I created an example for a level editor that does not use its own level building interface, but instead makes use of MMF2's own frame editor. You can rearrange the background objects however you like in the first frame, then in the second frame it loads the level from an ini file. To compile the level first, simply run the application. This can save time since you don't have to build your own layout interface from scratch. It works by running a fast loop, picking objects at random and recording their type and position, then deletes that object. It keeps running the loop until there are no more objects to record.
Extensions used are Ini++ v1.5 for storing level data and the Platform Movement Object (simply for testing purposes as a platformer game). I commented the events, so it should be fairly straightforward. Important notes; you can change the file name for the level in the global strings properties, and object type is stored in the active object's alterable values. This is important when adding your own objects, they use alt values for unique identifiers. I also have it set up to save the levels in the same directory as the mfa file, you can change that in my events if you want it elsewhere.
Hopefully some of you will find this useful. Please notify me of any problems. I have it fully working and I didn't find any issues with it however.
Edit: For learning purposes, I left the ini file open for you to look at how the data is stored. Ini++ allows you to easily save it as an encrypted file if you don't want people playing around with your level layout. I also just noticed that in the level loading, I had the center dirt tile pasted into the background with obstacle collision. This is unnecessary for that tile type since it won't be touched by the player (not sure if that really matters for performance reasons, but thought I'd point it out).