# Help with document class as file syntax

**URL:** <https://forum.kirupa.com/t/help-with-document-class-as-file-syntax/255080>\
**Category:** flash\
**Created:** [March 18, 2008, 8:15pm UTC](https://forum.kirupa.com/t/help-with-document-class-as-file-syntax/255080 "2008-03-18T20:15:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![schammy79](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@schammy79](https://forum.kirupa.com/u/schammy79)\
**Post date:** [March 18, 2008, 8:15pm UTC](https://forum.kirupa.com/t/help-with-document-class-as-file-syntax/255080/1 "2008-03-18T20:15:39Z")

</div>

The following lines of code were on the main timeline and now need to go in a document class .as file…  
How do I re-write them properly?

**closebutton.addEventListener(MouseEvent.CLICK, unloadFunction);**

\*\*function unloadFunction(event:MouseEvent) {  
dispatchEvent(new Event(“UnloadMe”, true));  
}

\*\*
