# How can I kill a function if a inputTextField is empty

**URL:** <https://forum.kirupa.com/t/how-can-i-kill-a-function-if-a-inputtextfield-is-empty/305217>\
**Category:** flash\
**Created:** [February 21, 2010, 6:51pm UTC](https://forum.kirupa.com/t/how-can-i-kill-a-function-if-a-inputtextfield-is-empty/305217 "2010-02-21T18:51:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fs\_tigre](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@fs\_tigre](https://forum.kirupa.com/u/fs_tigre)\
**Post date:** [February 21, 2010, 6:51pm UTC](https://forum.kirupa.com/t/how-can-i-kill-a-function-if-a-inputtextfield-is-empty/305217/1 "2010-02-21T18:51:37Z")

</div>

Hi,

I have a small aplication with two inputTextFields and a button, when the button is pressed it triggers a function that calculates the value in the two text fields, and everything is fine but when the textFileds are empty which is the default value and the button is press I get an error (Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.)

My question is how can I detect if the inputTextFileds are empty and some how kill the main function ?

function Name: calculate  
Input Text Field 1: partL\_txt  
Input Text Field 2: partW\_txt  
Button Name: enterBtn

Thanks a lot!
