Chad,
I normally pass the username and an encrypted password in the html
wrapper by modifying the flashvars parameter in the
index.template.html file and set the remote credentials in the
creationComplete handler of the Application. This is only needed
when the CFC is in a directory secured by CFLogin.
<mx:Script>
<![CDATA[import mx.core.Application;
private function creationCompleteHandler():void {
var username:String = Application.application.parameters.username;
var pwd:String = Application.application.parameters.pwd;
myFlashRemote.setRemoteCredentials(username,pwd);
}
private function submitJob():void {
myFlashRemote.jobNum();
}
]]>
</mx:Script>
Maury
--- In [email protected], "Chad Gray" <[EMAIL PROTECTED]> wrote:
>
> I posted to the Apollo forum, but this is more of a Flex question.
>
> How would one use this setRemoteCredentials() method?
>
>
http://livedocs.adobe.com/flex/201/langref/mx/rpc/remoting/RemoteObjec
t.html#setRemoteCredentials()
>
> Do I place it in my submitJob function in the example code below?
>
> Here is my basic code that I am passing a job number to a cfc and I
get a result back from it.
>
> Also how does the CFC need to be setup to even use this
RemoteCredentials information?
>
>
> <mx:Script>
> <![CDATA[
> private function submitJob():void {
> myFlashRemote.jobNum();
> }
> ]]>
> </mx:Script>
>
> <mx:RemoteObject id="myFlashRemote" destination="ColdFusion"
source="test" endpoint="http://demo.dev/flex2gateway/">
> <mx:method name="jobNum">
> <mx:arguments>
> <jobNumber>{jobNumber.text}</jobNumber>
> </mx:arguments>
> </mx:method>
> </mx:RemoteObject>
>
> <mx:TextInput x="94" y="47" id="jobNumber"/>
>
> <mx:Button x="134" y="98" label="Submit" click="submitJob()" />
>
> <mx:TextArea width="356" height="29"
text="{myFlashRemote.jobNum.lastResult}" x="10" y="10"/>
>