# IF and onEnterFrame problems

**URL:** <https://forum.kirupa.com/t/if-and-onenterframe-problems/239964>\
**Category:** flash\
**Created:** [September 27, 2007, 6:27pm UTC](https://forum.kirupa.com/t/if-and-onenterframe-problems/239964 "2007-09-27T18:27:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AJSimpson](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@AJSimpson](https://forum.kirupa.com/u/AJSimpson)\
**Post date:** [September 27, 2007, 6:27pm UTC](https://forum.kirupa.com/t/if-and-onenterframe-problems/239964/1 "2007-09-27T18:27:45Z")

</div>

Hello there, I’m having this in my flash site, it’s for tweening an object…

```auto
_root.changeSlide = function() {
    // get rid of current slide
    _root.listenfor.onEnterFrame = function() {
            _root.logo._x = _root.logo._x - ((_root.logo._x +550)*.5)/10;
            trace(_root.logo._x);
            if (root.logo._x < -500) {
                trace("great_success!");
            }
    }
}

```

The object starts at the center of the stage, and when tracing the \_root.logo.\_x value (the objects X value) Flash gives me values over -500 (the values go up to -549.05). The problem is, that the IF sentence never goes true. Flash never traces “great success!”.

What is the problem here?.. Can anyone help. Thank you very much!
