# Event.REMOVED\_FROM\_STAGE - Writing a cleanup function for MC

**URL:** <https://forum.kirupa.com/t/event-removed-from-stage-writing-a-cleanup-function-for-mc/326209>\
**Category:** flash\
**Created:** [November 29, 2011, 3:23pm UTC](https://forum.kirupa.com/t/event-removed-from-stage-writing-a-cleanup-function-for-mc/326209 "2011-11-29T15:23:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rei\_flash](https://avatars.discourse-cdn.com/v4/letter/r/ecc23a/32.png) [@rei\_flash](https://forum.kirupa.com/u/rei_flash)\
**Post date:** [November 29, 2011, 3:23pm UTC](https://forum.kirupa.com/t/event-removed-from-stage-writing-a-cleanup-function-for-mc/326209/1 "2011-11-29T15:23:10Z")

</div>

This is actually following on my other question on some kind…  
[URL=“[http://www.kirupa.com/forum/showthread.php?369789-How-to-stop-movieclips-from-resetting-when-switching-sections-in-main-timeline](http://www.kirupa.com/forum/showthread.php?369789-How-to-stop-movieclips-from-resetting-when-switching-sections-in-main-timeline)”][http://www.kirupa.com/forum/showthread.php?369789-How-to-stop-movieclips-from-resetting-when-switching-sections-in-main-timeline](http://www.kirupa.com/forum/showthread.php?369789-How-to-stop-movieclips-from-resetting-when-switching-sections-in-main-timeline)

— I don’t like things get removed without me knowing!  
I needed to do clean up before the MC is gone … so after some digging I found this event:

Event.REMOVED\_FROM\_STAGE

So I am trying to ask for some conformation here:  
Is this the ONLY situation that my MC will be deleted automatically by Flash?

If so then I can just listen to this even and call my cleanup function when it happens…
