I'm investigating switching to Flash Builder 4 for building a complex game that currently lives purely inside Flash CS4. CS4 is a pretty terrible source code editor and debugger. It's also quite unstable. Many crashes caused by bad behavior in the SWF will take out the entire IDE so are almost impossible to debug. And I've heard other horror stories. To be clear, for this project I'm not interested in the Flex API, just the IDE.
Surprisingly, it seems Flash Builder 4 isn't really set up for this type of development. I was hoping for an "Import FLA" option that would import my Document Class, set it as the main entry point, and figure out where other assets live and construct a new project. What is the best workflow for developing a project like this?
What I tried:
-Create a new Actionscript Project in the same directory where my CS4 lives
-Set the primary source file to match the original project's source file and location
-Set my main FLA as "export to SWC", and added "SWC PATH" to my flash builder 4 project.
-Compile and run.. received many errors due to references to stage instance. I changed these to GetChildByName("stagename"). Instead, should I declare them as members of the main class? (this would mimic what flash CS4 does).
-My project already streams in several external SWF's. I set these to "Export SWC" to get compile-time access to classes and varaibles. This works fine in cs4, the loaded SWF's behave as if they were in the native project. Is the same recommended with FB4?
-Should I also be setting the primary FLA as "export to swc"? If not, how do I reference it from flex, and how does flex know which fla it should construct the main stage with?
-I'm getting a crash inside a class that is compiled in one of the external SWF's (with SWC). I cannot see source code for the stack inside this class at all. I CAN see member variables of the class, so symbol information exists. And I do see the stack with correct function names. I even see local variables and function parameters in the watch window! But no source. Is this a known bug, or "by design"? Is there a workaround? The class is compiled into the main project, but I still cannot see source. If FLEX doesn't support source level debugging of SWC's, then it's pretty useless to me. The project cannot live as a single SWF. It needs to be streaming and modular for performance and also work flow. I can see source just fine when debugging the exact same SWC/SWF through CS4.
-What is the expected workflow with artists/designers working on the project? Currently they just have access to all the latest source, and to test changes they run right through flash. Will they be required to license Flash Builder as well so they can test changes? Or should I be distributing the main "engine" as a SWF, and having it reference other SWF files that artists can work on? They they compile their SWF in CS4, and to test the game, they can load the SWF I distribute.
A whitepaper on this would be awesome, since I think a lot of folks are trying to go this direction. I spent a long time searching the web and there is quite a bit of confusion on this issue, and various hacks/tricks to make things work. Most of the information is stale from old releases (AS2!).
If a clean workflow I would happily adopt Flash Builder 4 as the new development tool for all the programmers. It's a really impressive IDE with solid performance, functional intellisense, a rich and configurable interface, a responsive debugger..I could go on and on. One request is shipping with "visual studio keyboard layout" for us C++ nerds.
Thanks very much for reading this novel!