# Help with if statement

**URL:** <https://forum.kirupa.com/t/help-with-if-statement/281048>\
**Category:** Uncategorized\
**Created:** [February 4, 2009, 12:08pm UTC](https://forum.kirupa.com/t/help-with-if-statement/281048 "2009-02-04T12:08:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vxd](https://avatars.discourse-cdn.com/v4/letter/v/848f3c/32.png) [@vxd](https://forum.kirupa.com/u/vxd)\
**Post date:** [February 4, 2009, 12:08pm UTC](https://forum.kirupa.com/t/help-with-if-statement/281048/1 "2009-02-04T12:08:03Z")

</div>

Hi,

I can’t seem to figure this out. It seems easy but I just can’t get it.

```auto

mLight.visible = false

      function eeLamp(evt:Event):void {
            
          
            if (mLight.visible == false) {
  //trace("lamp goes on");
               mLight.visible = true;
                
            }else if (mLight.visible == true; {
mLight.visible = false;
trace("lights goes off")
}

        }

```
