If you are at 360/Flex then you have the first issue of the Fusion Authority in your hand. If not, pick one up at the registration desk. For everyone else, we're shipping them out today so get your orders in before 2pm EST.
You want a professional technical journal that speaks to you, the Flex professional. You want content written by the experts, edited by experts and presented in an expert format.
Flex Authority brings you technical articles that will take you to the next level in your Flex development. They're easy to read and easy to understand, written by top names in the field. For $49.95 a year, get your Flex on four times a year! Our first issue premieres in August 2008.
If you subscribe before our first issue premieres, you'll get 10% off on the already-low subscription price.
Pre-Order Flex AuthorityHow to Set Up Flex 3 for a ColdFusion Backend
Part 1: Flash Remoting – It's easier than you think.
by James Holmes
Senior Systems Analyst
Curtin University of Technology, Western Australia
With Flex 3 and ColdFusion 7.02 or 8, Flash remoting is easier to use than ever. This tutorial will work with either version of ColdFusion and requires Flex 3.
Obtain Flex 3 builder. The 60 day trial is free and once you see how much time it saves, you just might want to keep it. If you don't have it you can use the free Flex 3 SDK to work with Flex, but this tutorial is geared around the builder.
Install ColdFusion developer edition on your local machine (with or without Livecycle Data Services – we're only using Flex Remoting for this part of the article, although LCDS will be used in future parts). This step is to make compiling and testing the finished Flex application easier (the compiler looks at the XML config files within your local ColdFusion install to work out how to connect to ColdFusion). Keep it simple and use it standalone on port 8500 for now. You can move your finished product to your production server when you are done, even if it's on a different platform and installed differently. The next part of this article will cover multiserver installs and other more complicated setups.
Get http://blogs.adobe.com/flexdoc/UseFlashRemotingUpdate_Blog.pdf for the latest information on ColdFusion’s Flash Remoting and see http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_4.html for the LiveDocs on Flex with RemoteObject. The topics examined in this tutorial are covered by those two docs.
Set up the Flex project:
Select the ColdFusion Flash Remoting radio button to compile in Flex Builder.
Click next and fill in the details. You can click Validate Configuration to make sure Flex can find the relevant services-config.xml or remoting-config.xml file, etc.
Click finish.
Create the MXML for your application. In the source view in Flex 3 Builder, enter the following code:
In the code above, we're telling Flex to connect to the destination called "ColdFusion" that's automatically defined in the ColdFusion install. The source, "testobj," is the name of our CFC.
Create the cfc "testobj.cfc" to which Flex will connect, in the webroot of your local ColdFusion server:
Click the run button in Flex 3 Builder; a browser window should pop up with a button. Click the button and a popup alert should appear with the current CF server time.
That's all you need to do to configure Flex 3 to work with ColdFusion Standard on a standalone installation; pretty simple, isn't it? In the next part we'll cover the slightly different setup necessary for a multiserver / J2EE install of ColdFusion with Apache and some potential issues with CFCs in ColdFusion mappings.
James is a Senior Systems Analyst at Curtin University of Technology in Western Australia, responsible for the University's fleet of CF7 servers. He blogs on ColdFusion, mxAjax, and related topics at http://www.bifrost.com.au/blog/.