Actionscript files and folders to package not working.


I'm using the 30 day edition to evaluate IDEA to use as the new IDE for my Actionscript games. I'm coming from Flash Builder - where all projects etc. are working, checked that.

I've added libraries okay to a rather complex project I've imported from FB4.7 and they seem to be found and working.

Where I'm having trouble is with packaging files and folders.

For example, in the Project Structure/Modules/Android screen I've added a folder called 'D:\Users\Gray\Documents\flash\BrainTeaserShapePuzzle\assets\textures' with a relative file in package of 'textures'. In the compiler options I've got 'Copy resource files to output folder' checked with 'all except *.as and *.mxml' selected. Yet when I build the project no /textures folder appears in my output folder (called 'out').

This appears to be the only thing stopping my project from working when I run it on the emulator. Interestingly when run on an actual device this folder *is* being created and the textures are loaded by the app as I'd expect.

Could really do with some help with this as it's already taken up several hours and I seem to be getting nowhere. Thanks in advance.

Comment actions Permalink

'Files and folders to package' and 'Copy resource files to output folder' are different concepts in IntelliJ IDEA.

'Files and folders to package' settings are respected only when APK (or IPA) is created. No other resources except those that are added to the table are included in the output table.

'Copy resource files to output folder' does what it says and nothing more. Resource files are searched for in the source folder(s) of the module.

Comment actions Permalink

Okay, understood, thanks for your answer.

How do I proceed?

This project has resources all over my disk and some on network drives.

In Flashbuilder I set each resource to be included in the project and it copies them to my /bin-debug directory when I build the project - refreshing them if any have been changed. Then they're there for my project to use like it had been packaged into an APK/IPA.

Can IDEA do this in any way? Otherwise I don't see the point of the emulator since any module that used resources wouldn't work.

Thanks for your help.

Comment actions Permalink

You can have more than one source root for the module, so you can add source roots pointing to all places where resources shoud be searched for. Though network drives may affect performance.
Other option is to collect required files manually and to copy them all to the project source root.

Comment actions Permalink

From what you're describing, is IDEA unable to maintain directory structures when it copies resources?

I'm finding it difficult to believe these basics are missing from what is otherwise a quite beautiful and powerful IDE.

As it stands I would have to change my whole way of working to use IDEA, which is a great shame.

Comment actions Permalink

I didn't say directory structure is not kept.
When IntelliJ IDEA copies resource files from the source folder(s) to the output folder, directory structure is preserved: relative path from the output folder to the copied file is the same as it is from the source folder to the original file.


Please sign in to leave a comment.