Actually... in Cairngorm, if a Command implements Responder the Command
*must* contain:
public function onResult( event : * = null ) : void {}
public function onFault( event : * = null ) : void {}
...and if a Command implements IResponder that changes to
public function result( event : Object ) : void {}
public function fault( event : Object ) : void {}
So in Graham's case, if he's using vanilla Cairngorm 2.0 his Commands are
implemeting Responder, so he can't use Event in place of *... if he goes to
Cairngorm 2.01 (my numbering, not a real thing) and uses IResponder he can
use an Object type for the arg... but to use any other arg type (like event
: Event) the Command would need to implement some totally new Responder
class.
Darren
>From: "Samuel D. Colak" <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: <[email protected]>
>Subject: Re: [flexcoders] Flex/Cairngorm Syntax
>Date: Tue, 15 Aug 2006 18:52:07 +0200
>
>The * is an approximation of the Object keyword. Can be any type. Im not
>sure whether the typing is preserved or not but im sure Matt can confirm
>this. In effect event is cast as any object rather than having a strongly
>typed function call. Be aware in doing this though as type coercion issues
>may occur later on when dealing with the result.
>
>Since all event classes usually subclass from Event, you might use Event
>rather than * for type safety.
>
>Regards
>Samuel
>
>On 15/8/06 15:02, "grahampengelly" <[EMAIL PROTECTED]> wrote:
>
> >
> >
> >
> >
> > Hi
> >
> > I am just embarking on my first Cairngorm based Flex app. In one of the
>sample
> > apps there is the following syntax
> >> public function onResult(event:* = null):void
> >> {
> >>
> >> }
> > Could somebody please explain exactly what the argument "(event:* =
>null)" is
> > actually doing. Obviously the argument is called 'event', I have got
>that far.
> > Is the asterisk a wildcard for the type, and if so why, and is the null
>a
> > default value if the argument is not supplied?
> >
> > I have had a look around the web and the docs but can't find any
>explanation
> > of this syntax. What is more, I am not getting it to work but as I don't
> > understand what it is supposed to be I'm not sure where the problem
>lies.
> >
> > Thanks for your help in advance...
> >
> > Graham
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/