There are a several solutions on the market for this, like AutoDesk’s Scaleform, UniSWF and Rad Game Tools’ Iggy. Since I wasn’t able to obtain a trial version of both Scaleform (which wasn’t yet released for Unity) and UniSWF (whose support didn’t answer to our email), I have examined Iggy in more detail.
We were quite surprised to see that Iggy gives you the freedom to program parts of your game either in Unity, or in Flash itself, using ActionScript 3. For instance, you could write a lot of actionscript code for the animation and simply dispatch input events like a key press through Iggy to the actionscript. Alternatively, you could limit the code in Flash as much as possible, and control everything from within Unity.
This sounds quite powerful, but unfortunately the process required to integrate it in a project can’t really be called user friendly. It seems that this still requires a lot of code that could as well have been hidden from the programmer’s eyes. Also on the stability side of the product, there’s still some work for Rad Game Tools – Unity crashed now and then while playing Flash animations.
Iggy is still relatively new and still has some issues, but it’s certainly something to look out for. I may have a second look at it again in a few months from now, and also evaluate Scaleform and UniSWF if possible.