Flexing for a Rich Client in Your Web Apps, Page 3
Deploying and Running a Flex Application
Running a Flex application is similar to running applications from other dynamic programming models. For a Flex application, you need to also have the Flex server running. If you are using Macromedia products, you can run the Flex server along with JRun.
With the server running, you have what you need to run your Flex application. As mentioned before, your MXML file and any corresponding ActionScript files should be simply copied into an area accessible to your server. Once there, you can simply call your program from the address line in the server.
If you were running the helloflex.mxml file from a local server, this could be as simple as typing http:://localhost:8700/helloflex.mxml. This should result in the program loading and displaying as shown in Figure 4:If you run this application and enter some text, you will see a form like Figure 4:
Figure 4: The HelloFlex Flex application.
It is worth digressing and considering what is happening with this application.
Like most Web pages, a request is made to the server for the Web page files. In this case, it is the helloflex.mxml file.
On the server, when the request is made, the Flex server converts the MXML file (and any ActionScript files) to a SWF. An HTML page that uses this Flash file is then returned to the browser. This page is displayed like any other HTML page with a Flash object.
If this page is called again, the server is smart enough to know that there is no need to re-create the SWF file because nothing has changed. This means the second and future calls can be faster than the initial call.
Macromedia Flex can be obtained from Macromedia. Unlike many development products for developers, you cannot simply download a trial version. You can, however, obtain a copy. You have to send money to cover the cost of shipping and handling ($8.99 when this article was written) and then wait for the CD to be shipped. You can order a CD from:
If you decide to publish a Flex application, you will need to license a full copy of Flex. The cost of licensing is around $12,000 US dollars for a dual CPU license. You can find more information on licensing at http://www.macromedia.com/flex.
Macromedia is definitely in touch with the experiences clients are wanting and has proven this with Flash and now with Flex. It also has tapped into the future by working to separate the interface from some of the other logic. Incorporating standards by using an XML-based markup as well as ECMA standard scripting languages also shows that they are aware of larger concerns of organizations.
Where I see the challenge is in proving that Flex is ready for prime time by proving it can hold up to large-scale applications. This is a test I couldn't do for this review. There are also other smaller issues, such as being compatible with search engines. This compatibility is in the form of having site pages that can be found and indexed by the search engines. If this isn't fully available, then the visibility of a site using Flex will be greatly diminished.
Right now, it is easy for the average developer to confuse Flex with Flash and thus not give it a second thought; or worse, they will think of it as just another designer's tool. This leads to the biggest challenge I see, yet it is one of the easier challenges to overcome. It is getting the product into the hands of developers. This is the first step in building developer awareness. If developers are not aware of the product, they obviously won't use it. Even if they are aware of the product, they need to be able to easily obtain it as well as information on what it can do.
If this product is to succeed on a large scale, it will require a strong push into the developer community. It will take getting the products into the hands of developers—something that won't happen if they have to send in $8.99 and wait a week.
This is an exciting enough product that I do believe it is worth getting your hands on a copy!