Highlighted

CF11 Actionscript 3 - I'm migratiing from AS2 and can't use REMOTING, so how to use cfc's and process their results?

Explorer ,
Jun 11, 2014

Copy link to clipboard

Copied

The CF11 integration notes describe how to do use Flash Remoting. I use that in my AS2 code and it works fine. I'm trying to migrate to AS3 where there is no Remoting. I have done the following:

import flash.net.*;
import flash.events.*;

var CFCService = new NetConnection()
CFCService.objectEncoding = 0;
CFCService.connect("http://localhost:8500/flashservices/gateway/")

var responder2 = new Responder(getActiveUsers_Result, onFault);
CFCService.call("cfc.SyslockComponents.getActiveUsers", responder2);

stop();


function getActiveUsers_Result(result:Object):void
{
    trace("getActiveUsers Result Status: " + result.STATUS);
    for (var property:String in result)
    {
        trace(property +" : " +result[property]);
    }

}

The OUTPUT of my program shows the contents of the STRUCT returned by the CFC:

getActiveUsers Result Status: ALLOK  <<<<<< the CFC completed successfully
RECCOUNT : 1  <<<<<<<< There was one record select by query
DETAILS : [object Object]  /<<<<<< this contains the query results
STATUS : ALLOK

I don't know how to process DETAILS because RECORDSET is not available in AS3.

TOPICS
Flash integration

Views

561

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

CF11 Actionscript 3 - I'm migratiing from AS2 and can't use REMOTING, so how to use cfc's and process their results?

Explorer ,
Jun 11, 2014

Copy link to clipboard

Copied

The CF11 integration notes describe how to do use Flash Remoting. I use that in my AS2 code and it works fine. I'm trying to migrate to AS3 where there is no Remoting. I have done the following:

import flash.net.*;
import flash.events.*;

var CFCService = new NetConnection()
CFCService.objectEncoding = 0;
CFCService.connect("http://localhost:8500/flashservices/gateway/")

var responder2 = new Responder(getActiveUsers_Result, onFault);
CFCService.call("cfc.SyslockComponents.getActiveUsers", responder2);

stop();


function getActiveUsers_Result(result:Object):void
{
    trace("getActiveUsers Result Status: " + result.STATUS);
    for (var property:String in result)
    {
        trace(property +" : " +result[property]);
    }

}

The OUTPUT of my program shows the contents of the STRUCT returned by the CFC:

getActiveUsers Result Status: ALLOK  <<<<<< the CFC completed successfully
RECCOUNT : 1  <<<<<<<< There was one record select by query
DETAILS : [object Object]  /<<<<<< this contains the query results
STATUS : ALLOK

I don't know how to process DETAILS because RECORDSET is not available in AS3.

TOPICS
Flash integration

Views

562

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 11, 2014 0

Have something to add?

Join the conversation