I was getting the same CFC cannot be invoked error. What I found out, from my 
set up, that I was using MySQL and you cannot add a true/false to the database 
as a Boolean field. Its either a 1 or 0. If you create a varchar field, the 
code works fine.

Not sure what type of DB you were using or how you set up your tables.

----------------------------------------
From: "Wally Kolcz" <[email protected]>
Sent: Tuesday, August 11, 2009 10:15 AM
To: [email protected]
Subject: re: [flexcoders] Re: ameature question but am desperate 

Ohhh I am wrong, you want to pass in a Boolean. So forget my last response. 
However. I still am curious about your CFC path and your CFC, itself, it 
returning a 'String' (returnType), but you're not returning anything after the 
query

----------------------------------------
From: "stinasius" <[email protected]>
Sent: Tuesday, August 11, 2009 6:00 AM
To: [email protected]
Subject: [flexcoders] Re: ameature question but am desperate 

this is the code

"mxml file with Remote object call"

<?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:ResultEvent):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="handleStringResult(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="insertHandler()"/>      

</mx:Application>

"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>



Reply via email to