You probably figured this out by now but in the 2nd example you’re passing 5 parameters when the signature expects 4.  Otherwise what you’re trying to do is correct.

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Aly Sidi
Sent: Sunday, October 16, 2005 8:38 PM
To: [email protected]
Subject: [flexcoders] Passing delegates / function signatures [with Code Sample]

 

Hi Guys,
I know my syntax is correct because both samples compile but only the first sample calls QueryResult.
The reason i need to pass function pointers i baecause since flex remoteobjects are async i have a function that i may want to handle the results differently based on form data bindings


 This works :
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<mx:Button label="Execute Query" click="ExecuteQuery(RequestParams.requestXML,RequestParams.dataflow,RequestParams.provider,null);"/>

function ExecuteQuery(requestXML:String, dataflowName:String, providerGroup:String)
             {
                mySDK.addEventListener("ExecuteQueryResult", Delegate.create(this, QueryResult));
                mySDK.ExecuteQuery(requestXML, dataflowName, providerGroup);
             }

//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

But this Does NOT :

    <mx:Button label="Execute Query" click="ExecuteQuery(RequestParams.requestXML,RequestParams.dataflow,RequestParams.provider,null,Delegate.create(this, QueryResult));"/>

function ExecuteQuery(requestXML:String, dataflowName:String, providerGroup:String, callBack:Function)
             {
                mySDK.addEventListener("ExecuteQueryResult", callBack);
                mySDK.ExecuteQuery(requestXML, dataflowName, providerGroup);
             }

//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

can anyone tell me how to pass function pointers correctly?





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to