The problem is that you are not sending any data from Flex. You have

remoteObj.userData.send()

on creationComplete but you do not have any parameters for that function so no 
data is sent. The CF code requires the username and password parameters but 
does not get them.

You obviously want to send this data with your call but you can't if you invoke 
the remoteObject call on creationComplete.

So, the first thing to do is remove the invocation from creationComplete. Next, 
you should add a button to your form and create a function to run on click of 
the button.

<mx:Button label="Login" click="doLogin()"/>

private function doLogin():void
{
  remoteObj.userData.send();
}

<mx:RemoteObject id="remoteObj" destination="ColdFusion"
source="example3.cfc.log">
<mx:method name="userData" result="concernOriginalReceived(event)"
fault="Alert.show(event.fault.faultString,'Error');">
<username>{username}</username>
<password>{password}</password>
</mx:method>
</mx:RemoteObject>

This is only one way of doing it. There are others.

I would recommend using Charles (http://www.charlesproxy.com) to debug these 
kinds of errors. You would see very quickly that Flex did not send any data.

HTH


Steve


--- In flexcoders@yahoogroups.com, "johndoematrix" <johndoemat...@...> wrote:
>
> guys i just read up on this and am doing it the same way as the example. here 
> is the example i refered to just to be sure i got this right.
> 
> Passing parameters using a form
> 
> To pass parameters to components using an HTML or ColdFusion form, the names 
> of the client input controls must match the names of the parameter definition 
> in the component file.
> To pass parameters using a form:
> 
>    1. Open the corpFind.cfm file and modify the code so that it appears as 
> follows:
> 
>       <h2>Find People and Products</h2>
>       <form action="components/corpQuery.cfc" method="post">
>         <p>Enter employee's last Name:</p>
>         <input type="Text" name="lastName">
>         <input type="Hidden" name="method" value="getEmp">
>         <input type="Submit" title="Submit Query"><br>
>       </form>
>       <form action="components/corpQuery.cfc" method="post">
>         <p>Enter maximum product price:</p>
>         <input type="Text" name="cost">
>         <input type="Hidden" name="method" value="getCat">
>         <input type="Submit" title="Submit Query">
>       </form>
> 
>       In the example, the form tag action attribute points to the corpQuery 
> component. The input tags invoke the component method.
>    2. Open corpQuery.cfc and add access="remote" to each cffunction tag, as 
> the following example shows:
> 
>       <cfcomponent>
>         <cffunction name="getEmp" access="remote">
>           <cfargument name="lastName" required="true"> 
>            <cfquery name="empQuery" datasource="ExampleApps" dbtype="ODBC">
>              SELECT LASTNAME, FIRSTNAME, EMAIL
>              FROM tblEmployees
>             WHERE LASTNAME LIKE '#arguments.lastName#'
>            </cfquery>
>            <cfoutput>Results filtered by #arguments.lastName#:</cfoutput><br>
>            <cfdump var=#empQuery#>
>         </cffunction>
>         <cffunction name="getCat" access="remote">
>         <cfargument name="cost" required="true"> 
>           <cfquery name="catQuery" datasource="ExampleApps" dbtype="ODBC">
>              SELECT ItemName, ItemDescription, ItemCost
>              FROM tblItems
>             WHERE ItemCost <= #arguments.cost#
>            </cfquery>
>            <cfoutput>Results filtered by #arguments.cost#:</cfoutput><br>
>            <cfdump var=#catQuery#>
>         </cffunction>
>       </cfcomponent>
> 
>       In this example, the cffunction access attribute lets remote clients, 
> such as web browsers and Flash applications, to access component methods.
> 
> this is not different from what am doing the only difference may is that am 
> using a flex form but i think that doesn't matter.
>


Reply via email to