# Tween Class actionscript errors, please assist

**URL:** <https://forum.kirupa.com/t/tween-class-actionscript-errors-please-assist/251088>\
**Category:** Uncategorized\
**Created:** [February 5, 2008, 9:39am UTC](https://forum.kirupa.com/t/tween-class-actionscript-errors-please-assist/251088 "2008-02-05T09:39:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aoh](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@aoh](https://forum.kirupa.com/u/aoh)\
**Post date:** [February 5, 2008, 9:39am UTC](https://forum.kirupa.com/t/tween-class-actionscript-errors-please-assist/251088/1 "2008-02-05T09:39:14Z")

</div>

Hi all,

I’m trying to create a gallery of thumbnail with a left and right button. I tried to turn off the LEFT button when the thumbnail has reached the extreme end, which is x = 0, but it isn’t working. I could only write basic actionscript with the help of the Kirupa tutorial, and could not understand why it isn’t working.

```auto

import mx.transitions.Tween;// Import tween class
import mx.transitions.easing.*;// Import easing class

leftButton.onPress = function() {
    if (mcName._x<=-910) {
        var myTween:Tween = new Tween(leftButton, "_alpha", Strong.easeIn, 100, 0, 3, true);
    } else {
        var myTween:Tween = new Tween(mcName, "_x", Strong.easeInOut, mcName._x, mcName._x+970, 10, false);
    }
}

rightButton.onPress = function() {
    if (mcName._x=>2700) {
        var myTween:Tween = new Tween(rightButton, "_alpha", Strong.easeIn, 100, 0, 3, true);
    } else {
        var myTween:Tween = new Tween(mcName, "_x", Strong.easeInOut, mcName._x, mcName._x-970, 10, false);
    }
}

```

But the code couldn’t work :(.

This is my code for the thumbnail gallery that works WITHOUT me messing up the script:

```auto

import mx.transitions.Tween;// Import tween class
import mx.transitions.easing.*;// Import easing class

leftButton.onPress = function() {
    var myTween:Tween = new Tween(mcName, "_x", Strong.easeInOut, mcName._x, mcName._x+970, 10, false);
    delete leftButton.onEnterFrame;
};

rightButton.onPress = function() {
    var myTween:Tween = new Tween(mcName, "_x", Strong.easeInOut, mcName._x, mcName._x-970, 10, false);
    delete rightButton.onEnterFrame;
};

```

Will appreciate if anyone could enlighten me. Really, really thanks in advance.
