# EventListener problem

**URL:** <https://forum.kirupa.com/t/eventlistener-problem/247087>\
**Category:** flash\
**Created:** [December 18, 2007, 1:35pm UTC](https://forum.kirupa.com/t/eventlistener-problem/247087 "2007-12-18T13:35:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lunetics](https://avatars.discourse-cdn.com/v4/letter/l/c2a13f/32.png) [@lunetics](https://forum.kirupa.com/u/lunetics)\
**Post date:** [December 18, 2007, 1:35pm UTC](https://forum.kirupa.com/t/eventlistener-problem/247087/1 "2007-12-18T13:35:53Z")

</div>

In my application there are four different interfaces/layouts: start, recording, playback and save data. In all layouts you can go forward and backward. Before loading a new layout (all done by ActionScript) it removes all display objects and after that all listeners associated (I´m using a weak listener reference). The problem is when you go back and forward a couple of times buttons, timers etc. don´t work anymore. I can´t see the “light in the tunnel” yet because It removes all listeners and display objects before creating new so it always start from the beginning. **Any suggestions why this happends?**

_I´m using a state design pattern for play/stop/pause/record/append state wich gives a good structure, but when it comes to create and remove interface/layouts it feels very messy. Anyone who can share some ideas of how to structure up the layout-events-thing?_
