Hi guys, I’ve got myself in a pickle that I don’t think can be solved, but I’d appreciate anyone’s thoughts.
I’ll explain a little about what I was hoping to achieve, my experiments and why I think that it may not be possible in FlashDevelop/CS5. If anyone can offer pointers on something I’m doing wrong or a better approach it would be greatly appreciated.
I’m currently planning out the UI for a game with a complex UI system. I have done some runtime sharing tests using fonts that are setup for sharing in one fla, and I’ve setup the import in another. Both files are exported as swc files and are included in the flash develop project (the font is included completely). This worked fine.
But…
What I would like to do is have my UI loaded on-demand. I was planning to have a general UI elements library that contains elements setup for sharing (similar to the font), then have separate swfs that are loaded into the main swf when they are needed. These separate swfs would use elements from the shared library. I can get this to work exclusively in the IDE, or exclusively on the server, but not both (making development awkward).
The big stumbling block I’m hitting is to do with setting up the URL paths.
I think that all of the runtime paths will be based on the running ‘Main’ swf location. So all import/export paths need to use paths that work from this root location.
for example ‘data/ui/top_ui.swf’ might import objects from ‘ui_elements.swf’ (effectively ‘data/ui/ui_elements.swf’). This import will function fine when testing from the IDE, but when running on the server, this will fail as it will try to load ‘ui_elements.swf’ from the root folder. Worse still, it will not fire an error (as it has found ‘top_ui.swf’ fine) but the load will never complete as it cannot find the runtime swf.
The reason for this folder structure is that we would really prefer to keep our assets in a folder that could in theory be re-located to another server (should the bandwidth usage dictate it). To put these ui swfs in their own folder then causes all the linkage to break in the Flash IDE making editing a kludge. Fix it in the IDE and it will no longer function on load.
At the moment it looks like we will just have to export swc files and embed the lot in the main swf to keep this easy for code and art.
It would be a great feature to be able to dictate the root folder, or affect runtime linkage from code in some way. Is there a way or am I simply barking up the wrong tree?
Thanks,
: D