# Simple? nested if´s problem

**URL:** https://forum.kirupa.com/t/simple-nested-if-s-problem/292974
**Category:** flash
**Created:** [July 21, 2009, 3:06pm UTC](https://forum.kirupa.com/t/simple-nested-if-s-problem/292974 "2009-07-21T15:06:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![marcelomdsc](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@marcelomdsc](https://forum.kirupa.com/u/marcelomdsc)
#### Post date: [July 21, 2009, 3:06pm UTC](https://forum.kirupa.com/t/simple-nested-if-s-problem/292974/1 "2009-07-21T15:06:32Z")

</div>

I have the following code…

```auto
scrollFace.onEnterFrame = function() {
    if (scrollFace._y < 22.2){
    _root.gotoAndStop(1);
} else if (scrollFace._y > 22.2){
    _root.gotoAndStop(2);
} else if (scrollFace._y > 44.4){
    _root.gotoAndStop(3);
}
    
};

```

Which only works fine up to line 5.

Only the first if and the first else if are working,  
so I can go back and forth between frame 1 and 2  
with no problems, but it never goes to frame 3, and I  
need to add about 7 more else if statements but  
dont know what the problem is.

[You can download the file here in case I didnt make myself clear.](http://www.ginkgo.com.uy/descargas/slider.zip)

thanks!
