On 27/07/2010 13:45, John Singleton wrote:
----- Original Message ----
From: Taka Kojima<[email protected]>
To: Flash Coders List<[email protected]>
Sent: Mon, July 26, 2010 1:33:43 PM
Subject: Re: [Flashcoders] Listeners (was no subject)
John,
This is going to come across as harsh, however you really should maybe go
and get a book on AS3.
These problems, forgetting an import, trying to pass arguments to a
listener, etc. are pretty rudimentary, and not really the purpose of this
list.
Yep, a little rough. Got a good book. My question isn't how to pass arguments. I
know how to do that. My question is far more specific. It's why don't I have to
pass the e:Event argument? Why does the compiler complain that I only pass one
argument when I try to pass the other since apparently the first argument is
passed automatically? How can I pass that first argument manually when I can't
even see what it is? Didn't notice that Moock addressed those questions, so I
thought I'd ask here. Would you be so kind as to address those questions, not
how to "pass arguments"?
TIA,
John
When an event is dispatched, the event handling mechanism constructs an
event object that is passed as a function call argument to any functions
registered as event listeners for that event. This behaviour is part of
the event dispatch/handling contract.
If you try and call a function designed to be an event handler directly,
you must create an event object instance to correspond with the event
argument yourself when it is called.
There is no compiler magic involved.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders