# Closing Forms problem

**URL:** <https://forum.kirupa.com/t/closing-forms-problem/305292>\
**Category:** flash\
**Created:** [February 22, 2010, 11:32pm UTC](https://forum.kirupa.com/t/closing-forms-problem/305292 "2010-02-22T23:32:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spectator](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@spectator](https://forum.kirupa.com/u/spectator)\
**Post date:** [February 22, 2010, 11:32pm UTC](https://forum.kirupa.com/t/closing-forms-problem/305292/1 "2010-02-22T23:32:43Z")

</div>

Hello :). Have you ever had problems with closing forms? I have application with one form which is being created at runtime. The problem is that if the user closes the form the application process still stays.

```auto
private function loadNewOne():void {
            mdm.Forms.getFormByName("MainForm").show();
            mdm.Forms.getFormByName("SubForm1").hide();
        }
        
        private function ExitApplication():void {
            mdm.Forms.getFormByName("MainForm").show();
            mdm.Forms.getFormByName("SubForm1").hide();
        }
]

```

I am unable to listen or event something to the mainform, do you have any idea how can i close the mainform simultaneously with the subform?
