all groups > macromedia flash flash remoting > july 2005 >
You're in the

macromedia flash flash remoting

group:

AS Array to CFC



AS Array to CFC TK01
7/24/2005 12:00:00 AM
macromedia flash flash remoting: Hi,

I'm having problems passing an associative array to a CFC function via
Remoting.

The service call is working fine, having trouble getting the data out the
array.

Here is my AS:

//the array
infoForm_arr["fname"] = fname_txt.text;
infoForm_arr["lname"] = lname_txt.text;
infoForm_arr["email"] = email_txt.text;
infoForm_arr["phone"] = phone_txt.text;
infoForm_arr["address"] = address_txt.text;
infoForm_arr["city"] = city_txt.text;
infoForm_arr["state"] = state_txt.text;
infoForm_arr["zip"] = zip_txt.text;
infoForm_arr["comments"] = comments_txt.text;

//call funtion to call service
submitInfo(infoForm_arr);

//the array is passed as parameter to
//service call:

var pc:PendingCall=submitInfoService.submitInfo(infoForm_arr);


Here is the CFC function:

<cffunction name="submitInfo" access="remote" returntype="query">
<cfargument name="infoForm_arr" type="struct">

<cfset fname=infoForm_arr.fname>
<cfset lname=infoForm_arr.lname>
<cfset email=infoForm_arr.email>
<cfset phone=infoForm_arr.phone>
<cfset address=infoForm_arr.address>
<cfset city=infoForm_arr.city>
<cfset state=infoForm_arr.state>
<cfset zip=infoForm_arr.zip>
<cfset comments=Flash.Params[1].comments>

<cftransaction>

<cfquery name="q_insertOrder" datasource="ds" username="username"
password="william">

INSERT INTO people(fname, lname, email, phone, address, city, state, zip,
comments)
VALUES(fname, lname, email, phone, address, city, state, zip, comments)

</cfquery>

<cfquery name="q_getRecord" datasource="ds" username="username"
password="william">
SELECT MAX(order_id) as NewID
FROM orders
</cfquery>

</cftransaction>

<cfreturn q_getRecord>

</cffunction>



the cfc generates a new primary key on the table but know data is going in.

Any help would be great.
Re: AS Array to CFC TK01
7/25/2005 12:00:00 AM
ok, I'm totally frustrated. my code is just the the example code in the
livedocs.

why doesn't this work? No one in any of the forums I've posted has responded.

i need to do something similar with a complex, nested associative array. err.

I don't get it.


AddThis Social Bookmark Button