# Custom Events / Multiple Classes

**URL:** <https://forum.kirupa.com/t/custom-events-multiple-classes/246108>\
**Category:** flash\
**Created:** [December 7, 2007, 4:28am UTC](https://forum.kirupa.com/t/custom-events-multiple-classes/246108 "2007-12-07T04:28:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcusJones](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@marcusJones](https://forum.kirupa.com/u/marcusJones)\
**Post date:** [December 7, 2007, 4:28am UTC](https://forum.kirupa.com/t/custom-events-multiple-classes/246108/1 "2007-12-07T04:28:12Z")

</div>

Alright, so I guess my understanding of custom events isn’t that great. For discussion sake, let’s say I have three classes: base, object, custom eventdispatcher. The objects is an animation that uses the Tweener class. Once the animation is complete, it dispatches a custom event, “ANIM\_DONE.” Now, my understanding of events is that it should “bubble up” until reaches it’s listener, which I have setup in the base class. But I am getting nothing, which tells me it not making its way up to the base class. Here’s the code:

Base

```auto
package{
    import flash.events.*;
    import flash.display.*;
    import Animation;
    
    public class Base extends MovieClip{
        
        public function Base(){
            var anim:Animation = new Animation();
            var customEvent:CustomEvent = new CustomEvent();
            customEvent.addEventListener(customEvent.ANIM_DONE, nextAnimation);
        }
        
        public function nextStep(e:Event){
            trace("nextStep")
        }
    }
}

```

Object

```auto
package{
    import flash.events.*;
    import flash.display.*;
    
    public class Animation extends MovieClip{
        var ce:CustomEvent = new CustomEvent();
        public function Animation(){
            Tweener.addTween(logo, {alpha:1, time:.5, delay:5.7, transition:"easeInQuart", onComplete:ce.animFinished});
        }
    }
}

```

CustomEvent

```auto
package{
    import flash.events.*;
    
    public class CustomEvent extends EventDispatcher{
        public static const ANIM_DONE:String = "animDone";
        
        public function animFinished():void{
            trace("animFinished");
            dispatchEvent(new Event(CustomEvent.ANIM_DONE));
        }
        
    }
}

```

What am I missing? Thanks in advance.
