When you click the Logout button, the application calls the
method, which sets the username and password to null, and logs out the user on the client
side. In addition, the application calls the
logout.
When you click the Get Secure Data button, the application calls the
MXML file, which, in turn, calls the
the CFC returns a string for purposes of this simple test application, but could be modified to
return data such as the results of a query.
The Flex application also includes the
display an alert box to indicate whether the login was successful or not.
The MXML file appears as follows:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.utils.ObjectUtil;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
private function logIn():void{
cf.setRemoteCredentials(this.username.text, this.password.text);
}
private function logOut():void
{
cf.setRemoteCredentials(null, null);
cf.logoutuser();
}
private function getData():void
{
cf.getData();
}
private function serverFault(event:FaultEvent):void{
Alert.show( ObjectUtil.toString(event.fault) );
Alert.show( "error" );
}
private function serverResult(event:ResultEvent):void{
Alert.show( ObjectUtil.toString(event));
Alert.show( "success" );
}
]]>
</mx:Script>
method, which handles server side
logoutuser
function in the CFC. The
getData
and
serverFault
serverResult
setRemoteCredentials
method in the
getData
getData
methods, which
Using Flash Remoting Update
function in
9
Need help?
Do you have a question about the COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 and is the answer not in the manual?
Questions and answers