# Event propagation problem

**URL:** https://forum.kirupa.com/t/event-propagation-problem/267087
**Category:** flash
**Created:** [July 28, 2008, 4:16pm UTC](https://forum.kirupa.com/t/event-propagation-problem/267087 "2008-07-28T16:16:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![henraa](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@henraa](https://forum.kirupa.com/u/henraa)
#### Post date: [July 28, 2008, 4:16pm UTC](https://forum.kirupa.com/t/event-propagation-problem/267087/1 "2008-07-28T16:16:08Z")

</div>

Hi guys,

I’m having some trouble with events. My application has a class structure similar to below.

-Main (Document Class)  
— BodyContainer  
------ BodyTextContainer  
------ ImagesContainer  
— ContentsContainer  
------ SectionsContainer  
------ SubsectionContainer

The App has a list of manuals to be displayed. This is handled by the Main class. When the user clicks on a manual an instance of ContentsContainer is loaded. This lists all the sections in the selected manual. When the user selectes a section to view, the SubsectionsContainer is updated. When they choose a subsection a custom event is dispatched to be received by Main, the ContentsContainer class should be removed and the BodyContainer should be instantiated to display the information in that subsection.

So I want to dispatch an event from SubsectionContainer that is received by Main that removes ContentsContainer and loads BodyContainer.

I can’t seem to get Main to respond to the event. Is this possible? It onty seems to work if I add an event listener in Main that is linked directly to the subsection container:

ContentsContainer.SubsectionContainer.addEventListener(…)

But obviously I don’t want to be hard coding like this in my app. Hope that all makes sense. Anyone got any advice?

Thanks very much!
