>>" But all those things I can do with normal events, I guess.

So my wordplay aside, given my example, you would not use a "normal event" for 
this type of thing (having a class check data states and broadcast a 
notification to any listening classes that a certain data state, i.e. the 
machine is in the "on" state because all levers are pulled) - what kind of 
"normal" event are you thinking of?  I'm wondering if you're thinking of a 
tight-coupled relationship between classes where every time a lever is pulled, 
you check to see if all other levers are also pulled and then tell the 
lightbulb class to light up - that's not a good way to do it, it creates hard 
(i.e. tightly coupled) dependencies between classes.  I would instead do as in 
my example, broadcast that a certain state of the data (all levers pulled) has 
been achieved.  Then ANY other class, (i.e. the lightbulb, the Wonky Widget, 
the Funky Fan Button, etc.) can listen and react to that state of the levers.  
As you code, you want to loosely or completely de-couple relationships as m!
 uch as possible - depending on the size of the project, the larger the size 
and complexity, the more you will benefit from doing this.


Jason Merrill
Bank of America     Instructional Technology & Media   ·   GCIB & Staff Support 
L&LD

Interested in Flash Platform technologies?  Join the Bank of America Flash 
Platform Developer Community 
Interested in innovative ideas in Learning?  Check out the Innovative Learning 
Blog and subscribe.






-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor
Sent: Thursday, December 18, 2008 5:42 PM
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Custom eventListener

Jason: This is all simplified, advanced coders would use some design
patterns or frameworks to handle all this, but you get the idea.

Maybe I am slow... or even dumb?
But all those things I can do with normal events, I guess.
So what I mean was an example of something you cannot do with normal event
or what is specific case for using a custom event?


Kind regards
Cor

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to