By definition an event handler shouldn't return a value, since no object can 
actually retrieve this value. You'll need to use some other way - perhaps you 
could save the result in a private variable inside you class, or have the event 
handler call another method. It depends on what you are trying to do.

 --
Laurent Cozic

Flash, Flex and Web Application development
http://pogopixels.com



----- Original Message ----
From: Berkay Unal <[EMAIL PROTECTED]>
To: [email protected]
Sent: Wednesday, August 6, 2008 3:25:53 PM
Subject: [flexcoders] Returning value inside a nested functions event?


Hi Coders

I want to return a value from a handler function that is nested inside a 
function. The scenario is to check the duplicate

Does anybody know how to achieve it?

public function checkDuplicate( email:String) :Boolean {
var checkStmt:SQLStatem ent = new SQLStatement( );
checkStmt.sqlConnec tion = conn;
varsql:String = "select * from people where email = '[EMAIL PROTECTED]' "; 
checkStmt.text = sql;
checkStmt.addEventL istener(SQLEvent .RESULT, function(e:SQLEvent) :Boolean {
var result:SQLResult = checkStmt.getResult ();
Alert.show(result. data[0]["name"])
returntrue;
});
//checkStmt. addEventListener (SQLErrorEvent. ERROR, errorDBHandler) ;
checkStmt.execute( );
}
-- 
Berkay UNAL
[EMAIL PROTECTED] com
    


      

Reply via email to