<?xml version="1.0" encoding="iso-8859-1"?><rss version="2.0">
<channel><title><![CDATA[ActionScript.org Flash, Flex and ActionScript Resources - Comments for article: Centralized Event Management in Actionscript 2.0]]></title><link>http://www.actionscript.org/resources</link><description /><language>en-us</language><copyright><![CDATA[http://www.actionscript.org/resources]]></copyright><generator>N/A</generator><webMaster>general.redirect@gmail.com</webMaster><lastBuildDate>Mon, 23 Nov 2009 16:40:32 CST</lastBuildDate><ttl>20</ttl><item><title><![CDATA[Comment #1]]></title><link>http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment3372</link><description><![CDATA[a little too much copy/pasting going on here:

 private function dispatchEvent(type:String, listener:Object):Void {
  _eventSource.removeEventListener(type, listener);
 }

otherwise good work ...<br/><br/>
(Comment posted by nokati at 3:53 am, Wed 23rd May 2007)]]></description><author>no@spam.com (nokati)</author><pubDate><![CDATA[Wed, 23 May 2007 03:53:26 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment3372</guid></item><item><title><![CDATA[Comment #2]]></title><link>http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment3393</link><description><![CDATA[You're right. That was a copy/paste error. The dispatch method should wrap EventDispatcher's dispatch method, not removeEventListener. Thanks!<br/><br/>
(Comment posted by Jason Cook at 11:07 pm, Wed 23rd May 2007)]]></description><author>no@spam.com (Jason Cook)</author><pubDate><![CDATA[Wed, 23 May 2007 23:07:08 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment3393</guid></item><item><title><![CDATA[Comment #3]]></title><link>http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment4037</link><description><![CDATA[Good theory and indeed an appropriate display of how Singleton patterns can be used to add another dimension to OOP. In the code demonstration I would suggest using addEventListener( 'event', this ); ('this' becoming the object reference instead of a new custom object) to preserve scopes in classes without any kind of workaround.<br/><br/>
(Comment posted by Tiemen Glastra at 5:22 am, Mon 18th Jun 2007)]]></description><author>no@spam.com (Tiemen Glastra)</author><pubDate><![CDATA[Mon, 18 Jun 2007 05:22:10 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment4037</guid></item><item><title><![CDATA[Comment #4]]></title><link>http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment4682</link><description><![CDATA[There is a problem with the code.
You have to call removeEventListener in the function broadcast before doing dispatchEvent otherwise the function call as listener will return   values twice..
If the listener function return 
"hi"
the next call it return
"hi"
"hi"
and the next
"hi"
"hi"
"hi"
...<br/><br/>
(Comment posted by Javier Ráez at 7:07 am, Mon 16th Jul 2007)]]></description><author>no@spam.com (Javier Ráez)</author><pubDate><![CDATA[Mon, 16 Jul 2007 07:07:48 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment4682</guid></item><item><title><![CDATA[Comment #5]]></title><link>http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment5138</link><description><![CDATA[Cool Demonstration, Jason Cook ! 
But I have one problem with listening to event when can I know that one event call is complete. 
Example : I have an event name getAllStudents which return all the students info. How can I write the code in action script to check that the student records has already load completed and how to know that getAllStudents event is complete.
I know you are so good at Event but I am at the beginning. 
If able, can you write a sample to check that the event calling is complete.

I strongly hope I will get some idea or solution for this.

Thanks and Waiting for answer

Kado
<br/><br/>
(Comment posted by Kado at 5:28 am, Fri 3rd Aug 2007)]]></description><author>no@spam.com (Kado)</author><pubDate><![CDATA[Fri, 03 Aug 2007 05:28:05 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment5138</guid></item><item><title><![CDATA[Comment #6]]></title><link>http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment5429</link><description><![CDATA[FIX FOR TARGET PARAM:

_target is a reserved word.

Change broadcast() method signature to use target:_targ, or something to that effect, and try it again.<br/><br/>
(Comment posted by Robertson Odom at 1:56 pm, Thu 16th Aug 2007)]]></description><author>no@spam.com (Robertson Odom)</author><pubDate><![CDATA[Thu, 16 Aug 2007 13:56:38 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment5429</guid></item><item><title><![CDATA[Comment #7]]></title><link>http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment5542</link><description><![CDATA[Hi Jason, I could not find you e-mail anywhere to contact directly so posting a comment instead.

In context of your Centralized Event Management: While there are some advantages of the centralized approach you describe, I also wonder how this approach scales. Since event delivery is no longer directed it suggests that all obejcts that subscribe to say 'clicked' event will now be notified but also if there is more then one object in the system which braodcasts the 'clicked' event, then any given suscriber will be notified multiple times. This not only means that some subsribers will be responding to events that they are not really interested in but it also means that there are many more event notifications being sent around. what are your thoughts on this ?

regards Denis<br/><br/>
(Comment posted by Denis at 8:29 pm, Tue 21st Aug 2007)]]></description><author>no@spam.com (Denis)</author><pubDate><![CDATA[Tue, 21 Aug 2007 20:29:33 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment5542</guid></item><item><title><![CDATA[Comment #8]]></title><link>http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment6337</link><description><![CDATA[Hi Jason,

Excellent concept, I've implemented the idea into my own EventRouter class (which is entirely based on your concept) but I've extended this with various methods to prevent faulty/duplicate event broadcasts. The framework has been applied many times by the company I work for and has helped solve some fundamental problems . 

I would think that a strict coder will  consider this to be an anti-pattern for the same reasons Global variables/Singletons are anti-patterns. However, like globals and singletons, many people mistake the use of such patterns  by applying it too loosely, using it as another excuse to make things global. Always draw a clear line between micro and macro management.

I have made this class into a Singleton, which is only allowed to handle a predefined set of events, preventing implementation abuse. Think big events such as 'applicationLoaded' or 'pageTransitionDone' or 'applicationStateChange'  which enable view components to respond to major events thus improving synchronous code flow throughout the entire application.

The fact that it is a singleton makes it easy to retrieve.

Excellent concept, very effective (proven by several big projects).<br/><br/>
(Comment posted by Tiemen Glastra at 3:46 am, Thu 27th Sep 2007)]]></description><author>no@spam.com (Tiemen Glastra)</author><pubDate><![CDATA[Thu, 27 Sep 2007 03:46:37 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment6337</guid></item><item><title><![CDATA[Comment #9]]></title><link>http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment12523</link><description><![CDATA[A very good job.  This has proven more than useful for both me and my company.  It should be noted that this has inspired two other articles.  One on the Borg Class (my own) and another on AS3's parallel topic.<br/><br/>
(Comment posted by CW.Allen-Poole at 12:10 am, Mon 19th Jan 2009)]]></description><author>no@spam.com (CW.Allen-Poole)</author><pubDate><![CDATA[Mon, 19 Jan 2009 00:10:13 CST]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment12523</guid></item><item><title><![CDATA[Comment #10]]></title><link>http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment13691</link><description><![CDATA[I don't understand...
Wouldnot it create a confusion, in case, there are two classes, sending events with the same name ?<br/><br/>
(Comment posted by Vishwas at 5:53 am, Tue 17th Nov 2009)]]></description><author>no@spam.com (Vishwas)</author><pubDate><![CDATA[Tue, 17 Nov 2009 05:53:57 CST]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment13691</guid></item><item><title><![CDATA[Comment #11]]></title><link>http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment13692</link><description><![CDATA[I don't understand..
Wouldnot this create a confusion.. if two classes dispatch event with the same name ? 
Thanks.<br/><br/>
(Comment posted by Vishwas at 5:55 am, Tue 17th Nov 2009)]]></description><author>no@spam.com (Vishwas)</author><pubDate><![CDATA[Tue, 17 Nov 2009 05:55:14 CST]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/610/1/Centralized-Event-Management-in-Actionscript-20/Page1.html#Comment13692</guid></item></channel></rss>