Setting up flash remoting with actionscript 3.0 and ColdFusion
Create a fla, call it remoting(or something that makes sense to you).

In the actions, type the following code

var gateway:NetConnection = new NetConnection();
var responder:Responder=new Responder(onResult,onFault);

function onResult(responds:Object):void {
    trace("cfc result"+":"+" "+responds.toString());

function onFault(responds:Object):void {
    //loop over the fault structure
    for (var i:String in responds) {
        trace( i + ":" + responds[i] );


// name the default cf test server on this machine

// name of the cfc and the function in it that you want to hit in dot notation"com.cfcs.getTest.getTestConn", responder/*this is where any arguments to the remote call go*/);

The cfc lives on my localhost/com/cfcs/gettestConn.cfc

The cfc will look like this

<cfcomponent displayName="getTest">
  <!--- Establish a Flash Remoting Connection --->
  <cffunction name="getTestConn" access="remote" returnType="string" output="true">
    <cfreturn "....connection successful">

When you run your flash file you should see this in the output window

download project

Move com folder to your ColdFusion localhost host, if you are running the default set up you will need to change the port to 8500. Then run the fla file, you should be fine, with flash & ColdFusion working together!

Any question, problems? Let me know I will try to help.
I will posting another example on how to display the results from your cfc, and later how to pull database results into your flash movie as well.

By |2009-11-20T07:52:24+00:00November 20th, 2009|Actionscript 3.0, ColdFusion, Flash Remoting|