[flexcoders] Re: Programming 101: event target
Hi Matt and all, Thanks for the clarification. I know you guys are busy;) The DOM thing, target and currentTarget make sense. If a button or its parent container registers interest in a mouse click event, either the button or its container becomes currentTarget while the button is the target at bubbling propagation. In Flex/Flash, things like SystemManager (which is instantiated by Application and which inherits from flash.display.MovieClip) can also register its interest in any UIComponent(not stylized skins that are drawn by the drawing API), which as Matt says will broadcast the event(i.e., call the event handlers). In this case, currentTarget is the systemManager and target can be the visual stuff or the loader of the visual content under the stage who is the source of the event. Geng --- In flexcoders@yahoogroups.com, 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 flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Samuel Colak sam.colak@ 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 flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.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] Re: Programming 101: event target
For the same reason tree structures are upside down, with their roots at the top. ActionScript is from the Bizzaro world. --- In flexcoders@yahoogroups.com, gwangdesign [EMAIL PROTECTED] 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.
Re: [flexcoders] Re: Programming 101: event target
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 flexcoders@yahoogroups.com, gwangdesign [EMAIL PROTECTED] 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] Re: Programming 101: event target
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 flexcoders@yahoogroups.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 flexcoders@yahoogroups.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.
Re: [flexcoders] Re: Programming 101: event target
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 flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.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 flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.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.
Re: [flexcoders] Re: Programming 101: event target
Matt beat me to it. It's called Target because a belion 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 flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.comflexcoders%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 flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.comflexcoders%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]
RE: [flexcoders] Re: Programming 101: event target
We drive on the parkway and park on the driveway. If you pay too much attention to words, communication becomes impossible.. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Wednesday, September 24, 2008 6:51 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: Programming 101: event target Matt beat me to it. It's called Target because a belion 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] mailto:[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] mailto:[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_handlin g_4.html http://livedocs.adobe.com/flex/3/html/help.html?content=16_Event_handli ng_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 flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto: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 flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto: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 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 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf -1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo ! Groups Links (Yahoo! ID required) mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. http://flex.joshmcdonald.info/ http://flex.joshmcdonald.info/ :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]