Title: Re: [flexcoders] Flex/Cairngorm Syntax
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





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