# Nested IFs

**URL:** <https://forum.kirupa.com/t/nested-ifs/302326>\
**Category:** flash\
**Created:** [December 27, 2009, 12:47pm UTC](https://forum.kirupa.com/t/nested-ifs/302326 "2009-12-27T12:47:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrblonde](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@mrblonde](https://forum.kirupa.com/u/mrblonde)\
**Post date:** [December 27, 2009, 12:47pm UTC](https://forum.kirupa.com/t/nested-ifs/302326/1 "2009-12-27T12:47:55Z")

</div>

Hi,

I hope you can help ![](http://www.kirupa.com/images/emoticons/silly.gif)

I have a if statement that first checks to see if the enter key is pressed. Although i cant figure out how to to nest futher statements with in that initial statement. At the moment I’m checking for an enter keypress like so:

if (Key.isDown(Key.ENTER)) {

I suppose immediately after i want the script to see if a a textboxes variable is empty or not.

IF its empty run x code

IF it has content run y code.

Seems straight forward enough but i cant seem to figure out how to nest them under the first Enter key IF check.

Any advice gratefully received.
