# Onenterframe

**URL:** <https://forum.kirupa.com/t/onenterframe/213548>\
**Category:** Uncategorized\
**Created:** [January 20, 2007, 7:31pm UTC](https://forum.kirupa.com/t/onenterframe/213548 "2007-01-20T19:31:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Newbie123](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@Newbie123](https://forum.kirupa.com/u/Newbie123)\
**Post date:** [January 20, 2007, 7:31pm UTC](https://forum.kirupa.com/t/onenterframe/213548/1 "2007-01-20T19:31:12Z")

</div>

I have this function within my main timeline:

```auto
 
movie1_mc.onEnterFrame = function () {
 

 if (_global.1POSITION == "start" && _global.2POSITION == "finish" ) {
  trace ("work 1")
 
 delete this.onEnterFrame
}
}
 

```

This works fine. But if I then put an else if statement within this function, it doesnt read the else if statement. I know the statement is right because i deleted the above if code and tried putting the if else statement to it and worked fine.

Its like it can only read one if statement. Any ideas how to get around this? Maybe Im using the wrong function?
