There is a compiler available for Apache that works similar to the way that Flex 1.0 and 1.5 functioned. Also ColdFusion
has one built in which it uses for compiling flash forms on the fly. So it is possible to do and you can perform some real cool tricks with it if you know how.
So yes it can be done. I think it's called the "Web Tier Compiler" but not sure now that Flex 4 is released.