# Deleting/Stopping Functions

**URL:** <https://forum.kirupa.com/t/deleting-stopping-functions/281709>\
**Category:** flash\
**Created:** [February 12, 2009, 1:51pm UTC](https://forum.kirupa.com/t/deleting-stopping-functions/281709 "2009-02-12T13:51:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CTMusic](https://avatars.discourse-cdn.com/v4/letter/c/8c91f0/32.png) [@CTMusic](https://forum.kirupa.com/u/CTMusic)\
**Post date:** [February 12, 2009, 1:51pm UTC](https://forum.kirupa.com/t/deleting-stopping-functions/281709/1 "2009-02-12T13:51:43Z")

</div>

Hi Everyone -

In AS3, is there a code that can be used to delete or stop a function from running? For example in Frame 3, I have a function called createAnimation(); running, and when the user goes back to Frame 1, I want createAnimation(); to stop running, what is the best way of stopping or deleting the function?

Specifically - I am looking for a code structure for example:  
delete functionName(); (or in my case in my earlier example it would be  
delete createAnimation(); or kill functionName();…

And was wondering if there is such a code that just eliminates the function if we want to stop it from executing or running. It is so easy to create and call functions, but my brains are drawing a blank on creating the code to help void/kill the function.

Thanks for any help.

CT
