Experiencing problems with Flex/Flash Player 10/Maven
Hi everyone,
Just barely joined the community after a few frustrating days of dealing with this combination. I've been searching around the web and haven't found a good answer to this problem.
I'm working on a Flex application that leverages the FileReference.load method for pulling the data for a user selected image directly into the swf. I have one project that works fine in Flash Builder by itself. I have another project that works fine using the Maven flex mojo with the player configured to be Flash 10.
I don't, however, have a project that builds correctly in IntelliJ.
The primary reason I'm using IntelliJ is that the Maven integration with Flex is an order of magnitude better than trying to get Maven to play nicely with Flash Builder. However, this doesn't appear to be the case if you're attempting to use Flash Player 10 with the 3.5 version of the SDK via Maven. I can tell you that the project does correctly compile via Maven and produces an artifact that loads properly in Flash Player 10. In the IDE, the project compiles, but the artifact that is produced seems to fail calling the load method against the FileReference object, which leads me to think that it's not properly supporting 10.
Also, I don't see a way to tell IntelliJ to use the artifact generated by Maven; it seems to be dead set on using its own. The Maven artifact will be MyObject-0.1-SNAPSHOT.swf, but the IntelliJ artifact is _MyObject.swf. I can see where this is configured in the project files that IntelliJ maintains, but I cannot see where this is actually configured via any kind of module setting.
Any feedback on this is greatly appreciated.
Please sign in to leave a comment.
Hello, Chazz!
SWF files starting with underscore like _MyObject.swf are created because you have created main-class-based run configuration (probably by just pressing Ctrl+Shift+F10). You should select 'HTML wrapper of SWF file' instead at run configuration settings (Alt+Shift+F10, then 0). In this case 'Make before run' check box will do compilation exactly according to your Flex facet settings (Project Structure (Ctrl+Alt+Shift+S | Modules | <your module> | Flex facet).
But before that you should make sure that flexmojos project is imported correctly as written in http://blogs.jetbrains.com/idea/2009/09/flexmojos-inmaia/
Before importing you should:
- add <configurationReport>true</configurationReport> to all your Flex aware pom.xml files
- compile project by maven
In this case you'll have custom compiler configuration file called target/...-config-report.xml and there will be correct target player version and all other settings. Flex facet will be configured to use this file for compilation.