theseal53
theseal53

Reputation: 189

addEventListener inheritence in Actionscript 3.0

Ok, I have an extremely simple question that hopefully has an extremely simple answer.

I have a class, Handler, which is a base class for many other subclasses. Handler needs to add an event listener (addEventListener). The event listener will be listening for my class, GlobalVars, to say, "Hey! All the global variables have been set! Come and get them!"

However, I do not know where along the inheritance chain the method addEventListener is given. I do not want Handler to subclass a class with many methods like Sprite, because trying to find my custom functions in all those other functions is really ugly.

What class should I extend to inherit addEventListener?

Haha, or am I an idiot and have no idea what I'm doing?

Upvotes: 0

Views: 54

Answers (2)

Fergoso
Fergoso

Reputation: 1582

Inherit using the EventDispatcher class

Upvotes: -1

Marcela
Marcela

Reputation: 3728

You can inherit from the EventDispatcher class.

Upvotes: 2

Related Questions