Our Blog

Hello World exampleWhen we submitted our Flex-ColdFusion example to IFBIN, Flex was in an early beta, which means that the example doesn't work with the final release.

All IFIBIN authors have their signature "Hello World" example. Because what it represents us is the integration of Flex and ColdFusion, we decided that our Hello World needed to have ColdFusion in the mix.

I just updated the example and I am posting it here for download. I will submit the update to IFBIN soon. As you will see, it is very simple, as "Hello Worlds" should be. It shows how to use the RemoteObject tag to communicate with ColdFusion, how to deal with the server response and how to make a simple state transition.

View example
Download the source

Laura

Laura

14 Comments

  1. James
    Great Laura, I've followed your site very closely ever since I started programming in ColdFusion Flash Forms. You and you site have been a great source of help and inspiration.

    Now I see the power of Flex, but it still gets confusing when trying to access data to display in grids and forms and uploading data to be saved or updated. The built-in in wizards work but not knowing the real process makes it had to be creative with the design and power of Flex.

    I know with the sample you created here, you help me so much more, but this business of creating objects to pass and process it get confusing. Can you create a quick CRUD app that shows the easiest and most straight forward way of connecting to a backend data source using ColdFusion.

    Thanks in advanced for your input on this.

    P.S. Are you going to Max2006?, if you are we hope to see you there and finally have a chance to meet a legend in this field.
  2. Michael White

    Michael White

    I would like to see a Flex remake of one of your flash-form apps like the trio motors, real estate or contact manager in Flex 2.0. Something with some filtering and data refreshing (grid and combobox). I do a lot of forms with multiple related grids in CF flash forms but I'm hoping to convert it all to Flex
  3. Mark
    First off, I love this site. I have always learned so much. I have a question that is way off topic, but I am trying to send an e-mail through coldfusion (utilizing my smtp server) based off of a value in a cfgrid. Essentially, it shows all users for a site and their approved status. I want to be able to send a form letter e-mail to the user once their account is approved dependent upon the number of users that were approved in the grid. So basically if I approve 20 users then all 20 receive an e-mail.

    Thanks and hope to see everyone at MAX '06,
    Mark
  4. Chaz
    Hi to all,

    Laura,

    How can I create my on wrapper in cfm to show the flex app?

    Can I do this, create a cfform app and embed some flex apps module also?

    Thanks for all of your help
  5. Laura
    James,
    Thank you for your comments. For a basic example of add/update/delete you can take a look at My To-Do list (http://www.asfusion.com/projects/my-to-do-list/ ), although it is different than your regular form for CRUD.

    Yes, we'll be at MAX, so see you there!

    Michael,
    We are planning to update the Real Estate example. We posted a version but it doesn't compile now with the final release. I am also planning to do a series on how to convert flash forms to Flex.

    Chaz,
    Yes, you can create your own wrapper (html or cfm), a page that basically has the swf object reference. But you can't embed Flex apps inside flash forms because they are different versions of flash. You could load the swf with an img tag (like we do to load the file upload functionality into flash forms), but I am not sure if that will work because they use different actionscript versions and virtual machines.
  6. Boybles Maldooney

    Boybles Maldooney

    This is great! Have you considered a Cairngorm version of the same hello world example?
  7. Laura
    Boybles,
    I didn't think on doing the Cairngorm version, but it would be a good idea. For this simple example, however, people will think it is an overkill :)
  8. David Brannan
    Wonderful example.

    This worked well on localhost. When uploaded to my remote server it failed (same files). The server version was 7.01, so I ran the cummulative update to 7.02 yet it still failes:

    Any idea what could be the cause?

    =====================
    [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed"]
       at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
       at mx.rpc::Responder/fault()
       at mx.rpc::AsyncRequest/fault()
       at mx.messaging::ChannelSet/::faultPendingSends()
       at mx.messaging::ChannelSet/channelFaultHandler()
       at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
       at flash.events::EventDispatcher/dispatchEvent()
       at mx.messaging::Channel/mx.messaging:Channel::connectFailed()
       at mx.messaging.channels::PollingChannel/mx.messaging.channels:PollingChannel::connectFailed()
       at mx.messaging.channels::AMFChannel/mx.messaging.channels:AMFChannel::statusHandler()

    =====================

    If I can get this function I can start building a new app with real data - cool!
  9. Laura
    David,
    That usually means Flex cannot find the gateway. Are you sure everything is properly installed? Can you tell what port and address is it trying to access?
  10. David Brannan
    It turned out the server needed a restart after the update. Restarting services wasn't enough to do the trick. Sorry I didn't follow up sooner.
  11. Maury
    Laura,

    Great example !

    I was able to get this to work on my remote server.

    But when I try to run the example from your website I get the following error. I have tried this example from other machines here and at home and it works fine.

    I also receive it when running other Flex 2 / Flash Remoting examples, so I'm sure it's something wrong with this machine. Do you have any idea what could be causing this ?

    [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 200"]
       at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
       at mx.rpc::Responder/fault()
       at mx.rpc::AsyncRequest/fault()
       at mx.messaging::ChannelSet/::faultPendingSends()
       at mx.messaging::ChannelSet/channelFaultHandler()
       at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
       at flash.events::EventDispatcher/dispatchEvent()
       at mx.messaging::Channel/mx.messaging:Channel::connectFailed()
       at mx.messaging.channels::PollingChannel/mx.messaging.channels:PollingChannel::connectFailed()
       at mx.messaging.channels::AMFChannel/mx.messaging.channels:AMFChannel::statusHandler()

    Thanks,
    Maury
  12. Al
    I know this post is a little out-dated, but I figured I would try and see if anyone responds. I have been using flash remoting for a few years now (started with MX2004 and recently upgraded to 8... tried CS# and didn't like it at all).

    I have been thinking about going the Flex route, since I've heard that there are a lot of things Flex Remoting can do that Flash can't. My BIG question is this...

    I want to create a standalone program on the clients computer that they willingly install using Flex or Flash. This program connects to my servers flash gateway and accepts or denies login credentials (I've got that set up so far). I want to create an upload section that enables the user to select the file, and then this program passes it to the server and uploads the file, then parses through the data and inserts it into tables (I also have this setup on the server side, using flash forms.) My question is this....

    Can you pre-populate the "File" field in either Flah or Flex? Or can the file be passed through the gateway for the server to process? The problem is that this LUA file is hidden deep within the users hard drive, and browsing to the file can be a huge pain sometimes.. other times the person using the program doesn't always know what they are looking for.

    Any suggestions, or am Ijust out of luck?
  13. Mike
    Laura,

    My coworker and I have found your website to be an invaluable tool. We are CF programmers who have learned actionscript and flash remoting through your articles. In other words...thanks a million!

    In one of your posts above, dated 10/26/06, you said "I am also planning to do a series on how to convert flash forms to Flex." Did you you ever write that series? If so, where can I find it? We have developed numerous flash form cf apps for our company. We have started learning flex, but we would love for there to be an easy way to convert our existing apps into flex. I know you can grab the generated mxml code by doing a cfdump on the form, but pasting that into flex doesn't work for us. I know there must be config settings that need to be established first. Any tips and tricks you can tell us?

    thanks,
    -Mike
  14. Laura
    Hi Mike,
    Thanks!
    No, I never wrote that guide, but my recommendation right now is to simply learn Flex. There isn't all that much magic that happens in Flash Forms that you would not understand when writing Flex. Unfortunately, no, copying and pasting will definitely not work, for several reasons.