Matt beat me to it. It's called Target because a beeeeelion years ago, back
during the browser wars (grizzled veteran voice) somebody somewhere
(Netscape I'm looking at you) called it Target. And eventually that became a
DOM standard, and DOM's not just for HTML, it's for XML, and tree-like
documents in general. The Flex display list is more or less a big dom tree,
so IMO it was a pretty good choice.

-Josh

On Thu, Sep 25, 2008 at 8:13 AM, Matt Chotin <[EMAIL PROTECTED]> wrote:

> For one thing, target comes a little bit from the W3C DOM event model. It
> was standard naming for that I believe.
>
> Target represents the object on which can be thought of as having
> originally broadcast the event.  Whomever mentioned the UI part of it is
> right on.  When you think of the MouseEvent CLICK, the target is the actual
> display object that was clicked on.  CurrentTarget is useful when you're
> dealing with event propagation, it reflects the object that is currently
> broadcasting the event.  For example, if a button was clicked on but that
> button lives within a container, the container may dispatch the CLICK event
> via bubbling.  Basically indicating that something within it was clicked. In
> that case, currentTarget is the container, target is the original button
> that was clicked.
>
> I agree source might be a better name, but I think the UI aspect of it kind
> of held.
>
> Matt
>
>
> On 9/24/08 3:04 PM, "gwangdesign" <[EMAIL PROTECTED]> wrote:
>
>
>
>
> I just read the documentation for Flex, "The Event Flow":
>
> "Flash Player or AIR dispatches event objects whenever an event
> occurs. If the event target is not on the display list, Flash Player
> or AIR dispatches the event object directly to the event target. For
> example, Flash Player dispatches the progress event object directly to
> a URLStream object. If the event target is on the display list,
> however, Flash Player dispatches the event object into the display
> list, and the event object travels through the display list to the
> event target."
>
>
> http://livedocs.adobe.com/flex/3/html/help.html?content=16_Event_handling_4.html
>
> It looks to me like, in the case in which they mention above, "Flash
> Player" or "AIR" becomes the source who dispatches the event object
> and the event target is actually the one that "listens" to the event.
> Does this "target" term then sound something that makes more sense to
> lower level programming (such as Flash Player engineers?)? From an API
> user's point of view, an event source is only "source" anyways...
>
> Thanks.
>
> --- In [email protected] 
> <mailto:flexcoders%40yahoogroups.com<flexcoders%2540yahoogroups.com>>
> , Samuel Colak <[EMAIL PROTECTED]> wrote:
> >
> > Umm....
> >
> > You have "currentTarget" and "target" - most of the time, these return
> > very different
> > values depending on what happened ...
> >
> > On Sep 24, 2008, at 11:14 PM, Chuck Preston Jr. wrote:
> >
> > > For the same reason tree structures are upside down, with their
> > > roots at the top. ActionScript
> > > is from the Bizzaro world.
> > >
> > > --- In [email protected] 
> > > <mailto:flexcoders%40yahoogroups.com<flexcoders%2540yahoogroups.com>>
> , "gwangdesign" <gwangdesign@>
> > > wrote:
> > > >
> > > > Hi,
> > > >
> > > > I am just wondering why, in ActionScript, the subject of an event is
> > > > called a "target"? Is it kind of counter intuitive? In Java, it is
> > > > called "source", which sounds much more understandable to me.
> > > >
> > > > Thanks.
> > > >
> > >
> > >
> > >
> >
>
>
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location:
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
> Links
>
>
>
>


-- 
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

http://flex.joshmcdonald.info/

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]

Reply via email to