Here is a done sample of one of mine:
<mx:RemoteObject id="discountGateway" destination="ColdFusion"
source="com.isavepets.cfc.discounts.discountGateway"
fault="Alert.show(event.fault.message, event.fault.faultCode)">
<mx:method name="listByType" fault="Alert.show(event.fault.message,
event.fault.faultCode)" result="resultHandler(event)" />
</mx:RemoteObject>
the source equates to the root of the
site/com/isavepets/cfc/discounts/discountGateway.cfc
Inside my discountGateway.cfc is a function called listByType that takes a
single argument ('type')
I then call the function in AS like this:
discountGateway.listByType(type); (type being either static or passed in as an
argument)
----------------------------------------
From: amanyire arthur <[email protected]>
Sent: Monday, August 10, 2009 8:26 AM
To: [email protected]
Subject: RE: [flexcoders] Re: ameature question but am desperate
care to guide me?
--- On Mon, 8/10/09, Tracy Spratt <[email protected]> wrote:
From: Tracy Spratt <[email protected]>
Subject: RE: [flexcoders] Re: ameature question but am desperate
To: [email protected]
Date: Monday, August 10, 2009, 6:58 AM
I don't know CF or do much
RemoteObject, but I do not see where you are passing in the "cat"
argument value. Tracy Spratt, Lariat Services, development services
available
----------------------------------------
From: flexcod...@yahoogro ups..com [mailto: flexcod...@yahoogro ups.com ] On
Behalf Of stinasius
Sent: Monday, August 10, 2009 6:23
AM
To: flexcod...@yahoogro ups.com
Subject: [flexcoders] Re: ameature
question but am desperate
still no progress. here is my code please help on what
i shld do.
"chk.mxml"
<?xml version="1.0" encoding="utf- 8"?>
<mx:Application xmlns:mx="http://www.adobe. com/2006/ mxml"
layout="absolute" >
<mx:Script>
<![CDATA[
import mx.rpc.events. ResultEvent;
import mx.rpc.events. FaultEvent;
import mx.controls. Alert;
public function handleStringResult( event:ResultEven t):void{
onCompleteHandler( );
}
private function onCompleteHandler( ):void{
Alert.show(" Congratulations! ");
}
private function insertHandler( ):void{
catManager.cats( cat.selected) ;
}
]]>
</mx:Script>
<mx:RemoteObject id="catManager" destination= "ColdFusion"
source="chkbx_ dbinsert. insert" showBusyCursor= "true">
<mx:method name="cats" result="handleStrin gResult(event) "
fault="mx.controls. Alert.show( event.fault. faultString) "/>
</mx:RemoteObject>
<mx:CheckBox x="100" y="73" label="Cats"
id="cat"/>
<mx:Button x="100" y="99" label="Insert"
click="insertHandle r()"/>
</mx:Application>
"insert.cfc"
<cfcomponent>
<cffunction name="cats" access="remote" returntype=" string">
<cfargument name="cat" type="boolean" required="no" />
<cfquery name="regCat" datasource=" cats">
INSERT INTO cats(cat)
VALUES("#arguments. cat#")
</cfquery>
</cffunction>
</cfcomponent>
i get the following error when i try to insert the value of the chk box into
the database
"Unable to invoke CFC - Error Executing Database Query."