I pulled this from some Flex docs I was reading. It does a real good job of explaining how Macromedia Flex works on a request by request basis at a very high-level.
Flex application files use the .mxml filename extension. You store these files under the web root directory of your J2EE application.
A request to an MXML file has the following form:
Upon receiving an HTTP request for an MXML file, Flex performs the following steps:
1. Compiles the MXML file to produce a SWF file.
2. Caches the compiled SWF file on the server.
3. Returns the SWF file to the client.
The SWF file executes in Flash Player. While it is executing, the Flex application makes calls to server-side services. For example, the application might issue a SOAP request to a web service, use AMF to connect to a Java object, or make a request to an HTTP service.
Upon subsequent requests to the MXML file, the Flex server determines whether the MXML file has been modified since the previous request. If not, it returns the same SWF file from the cache. If the MXML file has been modified, the Flex server recompiles the file and returns an updated SWF file to the client.