listening for an object created event

  • Follow


Is it possible for an object, objClassB say, to listen for when an
object of another class, objClassA say, is being created (or has just
been created)?

I can define ClassA having an event and for the event to be broadcast
(using notify) at the end of the constructor.

However the syntax for adding a listener
addlistener(Hsource,'EventName',callback), and all of the examples
(that I can see) in the documentation require an objClassA to exist
already.
The examples typically show a method of ClassB being passed an
objClassA and the listener being added in the method.

But by that stage it's too late in that objClassA has already been
created.

I want an objClassB to listen for the creation of objClassA not just
listen for any changes that may occur to it.

Can this be done, and if so how?
0
Reply pouncingmoose 3/2/2011 6:03:29 AM


0 Replies
272 Views

(page loaded in 0.064 seconds)

Similiar Articles:













7/23/2012 6:44:11 PM


Reply: