Thanks Larry. I have managed to get so far, but I'm having trouble getting the results back from my query in my CFC to the elements of my form. Is there a online list of how to link form elements to the results function, as you have in your example " selectBoxY.dataProvider = results;" or do all elements have a dataProvider?
Do you have CF 7.1?
If so:
CFM Page.
<cfform action="" method="post" name="frm_test" preloader="no" format="flash" height="800" width="600" skin="haloblue" >
<cfformitem type="script">
function getSites()
{
//create connection the flash services gateway already exists you will not need to download or install anything new for coldfusion 7.1
var connection:mx.remoting.Connection = mx.remoting.NetServices.createGatewayConnection("http://<your domain>/flashservices/gateway/");
var myService:mx.remoting.NetServiceProxy;
var responseHandler = {};
//put the controls in scope to avoid calling _root
var selectBoxY = selectBoxY;
responseHandler. results: Object ):Void
{
//when results are back, populate the cfselect
selectBoxY.dataProvider = results;
}
responseHandler.onStatus = function( stat: Object ):Void
{
//if there is any error, show an alert
alert("Error while calling cfc:" + stat.description);
}
//get service the first attribute is the path to your cfc
myService = connection.getService("wip.com.circuit", responseHandler );
//make call
myService.GetSites();
}
</cfformitem>
<cfselect name="selectBoxY" label="Site" required="yes" width="200" site is required." >
</cfselect>
</cfform>
CFC:
<cfcomponent displayname="circuit" >
<cffunction access="remote" name="getSites" output="false" returntype="query">
<cfscript>
var sitesQuery = queryNew("data,label");
queryAddRow(sitesQuery);
querySetCell(sitesQuery,'data','1');
querySetCell(sitesQuery,'label','Dillon');
queryAddRow(sitesQuery);
querySetCell(sitesQuery,'data','6');
querySetCell(sitesQuery,'label','Georgia');
queryAddRow(sitesQuery);
querySetCell(sitesQuery,'data','10');
querySetCell(sitesQuery,'label','Plaza');
</cfscript>
<cfreturn sitesQuery >
</cffunction>
</cfcomponent>
Here all you should have to change is the domain name and change the path to the cfc.
This should give you a basic example of how to call a cfc using flash remoting.
I must reference ASFusion because 99% of this code is pulled from their site.
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Stephen Adams
Sent: Thursday, November 03, 2005 8:23 AM
To: [email protected]
Subject: Re: [CFCDev] Using CFC's with Flash forms without Flash remoting
Oh, all the tutorial I've seen seem to show that you have to install it. How do I call CFC's using flash remoting from CF server?
On 03/11/05, Muzak <[EMAIL PROTECTED] > wrote:
Remoting is built into ColdFusion. No need to buy anything to use it with Forms.
regards,
Muzak
----- Original Message -----
From: "Stephen Adams" <[EMAIL PROTECTED]>
To: < [email protected]>
Sent: Thursday, November 03, 2005 1:41 PM
Subject: Re: [CFCDev] Using CFC's with Flash forms without Flash remoting
The reason is I'd have to justify buying it, and I'm only playing with the
idea at the moment, so I don't think my boss would let me get it.
On 03/11/05, Aaron Foote <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> you could try accessing the CFC as an XML web-service
> ActionScript 2.0 seems to support XML services
>
> Why don't you want to use flash remoting??
>
> Cheers
>
> Aaron
>
> Stephen Adams wrote:
>
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting ( www.cfxhosting.com).
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
