|
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',' 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 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.
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] |
- Re: [CFCDev] Using CFC's with Flash forms without ... Aaron Foote
- Re: [CFCDev] Using CFC's with Flash forms wit... Stephen Adams
- Re: [CFCDev] Using CFC's with Flash forms... Muzak
- Re: [CFCDev] Using CFC's with Flash f... Stephen Adams
- Re: [CFCDev] Using CFC's with Flash f... Marco Antonio C. Santos
- RE: [CFCDev] Using CFC's with Flash forms wit... Chalmers, Larry
- Re: [CFCDev] Using CFC's with Flash forms... Stephen Adams
- RE: [CFCDev] Using CFC's with Flash forms wit... Chalmers, Larry
- RE: [CFCDev] Using CFC's with Flash forms wit... Chalmers, Larry
- Re: [CFCDev] Using CFC's with Flash forms... Laura Arguello
