On Mon, Apr 21, 2008 at 10:15 PM, Josh McDonald <[EMAIL PROTECTED]> wrote: > Are the callbacks members of the UM Event or something? Like do you do > > event.success = myFunc;
> > before you dispatchEvent() or something? Is there a copy of the api docs > online I can poke around in? I'm just looking to add similar functionality > to our existing in-house framework so I'm not missing out on any time-savers > :) > > -J Actually, Callbacks are object on their own. Imagine that login form... on the submit button handler you might have something along these lines: <code> var loginEvent :UMEvent = new UserEvent(UserEvent.LOGIN_USER); // or, as the UM guys prefer: new LoginUserEvent(); // with their type on the event // nevermind :-P loginEvent.user = new UserVO( userName.text, password.text ); loginEvent.callbacks = new CallBack( onLoginSuccess, onLoginFailed ); loginEvent.dispatch(); // the preferred way to reach the front controller. // etc. </code> where onLoginSuccess and onLoginFailed are functions right there, on the view. (You could pass these parameters through the event constructor as well.. that doesn't matter). the front controller tosses this event to the command's execute method, where you can extract and store all the info you needed. you there can then store the event and, when you're done on the command (when you received the succes or failure from the server via the delegate) you can then have the command run the appropriate method on the callback: so, on the command you have, on the result handler that received a successful result from the delegate you can run _loginEvent.callbacks.resultHandler(); // or _loginEvent.callbacks.faultHandler(); that will run onLoginSuccess or onLoginFailed on the view without you having to know where the view is or how those events were called. The code isn't hard to follow, check it out! http://code.google.com/p/flexcairngorm/source/browse Both the adobe and the um cairngorm classes are there. -- gabriel montagné láscaris comneno http://rojored.com t/506.8392.2040