Here is a small piece of code I wrote to demonstrate Interacting with a Command, through an Event while using a Cairngorm Framework.
The application connects to a WSDL webservice via Flash Builder 4 Data/Services to validate an Email address against the Email Server. Doesn’t work well with domains with a ‘Catch-All’ email address though !
- ValidateEmail.mxml dispatches an event (ValidateEvent) passing Email ID, along with a CallbackFunction as parameters.
- The ‘Data’ is received in the Cairngorm Command (ValidateCommand), and the Responder Result Function is set accordingly.
- Delegates into action
- We handle the Webservice response in ValidateEmail.mxml
For a better explanation, see Flex – Interacting with a Command, through an Event
Webservice used from WebServiceX
Do post in your comments !