View comments | RSS feed

Running Flex applications

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:

http://hostname/path/filename.mxml

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.


Version 1.5

Comments


pstoppani said on Jan 5, 2005 at 9:36 AM :
What is the advantage of compiling mxml on the server? Since the developer has to use tools to develop/debug each mxml, why not install precompiled .swf files and remove all this extra logic and load off the server?
danger42 said on Jan 6, 2005 at 5:58 AM :
The advantage of the server compile is that it is the same development process used by other web development models like JSP, ASP, and CF - first request compiles and from there the object is served from cache, unless changed. It's a productivity boon to developers who are working on code and can write, save and browse (without an intermediate compilation step) and it actually takes very few server resources. That said, it is very simple to build and deploy SWFs as precompiled objects, very much like you would servlets. There is a headless compiler that fits into your automated build system, you can create ANT tasks to coordinate and the whole thing can be deployed to your production server, exactly as you would any Java web app. The key is that you have the flexibility to use either model.

More info here:
http://www.macromedia.com/software/flex/productinfo/faq/#item-f1
http://www.macromedia.com/devnet/flex/articles/server_perf_02.html
http://www.macromedia.com/devnet/flex/articles/server_perf_06.html

HTH,

Matthew Horn
Sr. Technical Writer
Macromedia
No screen name said on Feb 23, 2005 at 10:45 AM :
who uses the word boon?
zaphodX said on May 5, 2005 at 8:20 PM :
I guess a sr. technical writer at Macromedia.. But laughs aside, it's a good word here.
albertocastillo said on Aug 31, 2005 at 7:06 AM :
When recompilation happen due to modified info against previous data, will the animation from the client side reset? or will it continue the animation and just reflect the modified data?
smgilson said on Sep 2, 2005 at 7:44 AM :
The Flex app only recompiles when you change a source code file, not when the data changes. Is that what you mean?

Stephen Gilson
Flex Doc

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/15/flex_docs_en/00002138.htm