no worries ;)

well the idea of the class is to break the rules of programing really all
the other event management classes try to do things legally while we are
trying to do it easily :) some classes focus on the most processor friendly
while we focus on the one that gives you the most power as a developer.

There are basicly 2 ways to work with the class :

1. with the EC - the event controller is a global class that way you can
use one class to control all events did you see the example files lets just
imagine this for a second imagine that you have a section on your site or
your application on a lot of classes but there all related to each other
when ever you leave that area you just want to kill all events(to avoid
memory leaks) the easiest way to do it is by when you add an event grouping
it up with a group name:

EC.add(btn, Event.ENTER_FRAME, loop, "group1");
EC.add(btn, MouseEvent.CLICK, onClick, "group1");
EC.add(btn, MouseEvent.ROLL_OVER, onOver, "group1");
EC.add(btn, MouseEvent.ROLL_OUT, onOut, "group1");

lets pretend we added this in a few classes and diffrent objects now when
ever you want to kill all the events you can from any place in your
application call

one more really cool feature is actually you can save the information
returned when you remove events:
var data = EC.remove('group1');
enabling you to restart them again (this is an undocumented feature by the
way :P)
then you can just restart it
EC.add(data);// and all the events will return

2. you can always create an LEC (local event controller) its the exact same
thing only instead of being a global class its a more private scope so you
can protect your creation from other areas of the site or create buckets
for managing events. that's really the basics of it.

best way to figure it out is to give it a run on a real project and see
what happens ;)

the advantages are : more control, easier to remove a lot of events at the
same time, and its mainly used for monitoring and grouping.

other libraries have advantages as well mainly when it comes to improving
performance as our class doesn't have the intention of helping performance
but helping cut down the amount of typing more then anything else and
making it easier to get things done faster and breaking with it the rules
of encapsulation (that everything should be separated im not a fan of rules
that make me type more) :)

On Mon, Jul 2, 2012 at 6:54 PM, Devon <> wrote:

> Oh, I didn't even think of that - I'll give it a try later...
> Meanwhile, I'm still a bit confused on how to use this class. Your
> examples and videos show how they're used when events are dispatched
> automatically within' the same class. How would I dispatch a custom event
> from an unrelated class?
> Thanks again! :)
> --
> --


*Ben Fhala*
HTML5, Javascript, ActionScript & Flash School
follow us on  @02Geek <>  ][  Subscribe to
Youtube   <>][ Like us on

02Geek is part of Everything Nice ,inc creations.


Reply via email to