A possibility to change this it to use Options, which can add events.

For example like this: http://jsfiddle.net/DauTK/

On Fri, Jun 1, 2012 at 4:40 PM, t.patrick.welborn <
t.patrick.welb...@gmail.com> wrote:

> I created two classes: A ButtonGenerator and a Button. The Button is a
> child of ButtonGenerator. When Button is instantiated and an event listener
> is attached in ButtonGenerator, Button does not appear to capture the
> fireEvent from Button.initialize.
>
> var ButtonGenerator = new Class({
> Implements:[Events],
>  initialize:function(){
>  this.button = new ButtonGuide();
> this.button.addEvent('buttonReady', function(){
> console.log('meh');
>  });
> });
>
> var Button = new Class({
> Implements:[Events],
>  initialize:function(){
> this.fireEvent('buttonReady');
> }
> });
>
> Why won't this work? Is it because the event listener is attached after
> Button.initialize completes? What is a better way to do this?
>

Reply via email to