# Tween Thumbnail Scrolling - trouble with button control

**URL:** <https://forum.kirupa.com/t/tween-thumbnail-scrolling-trouble-with-button-control/294209>\
**Category:** flash\
**Created:** [August 10, 2009, 9:50pm UTC](https://forum.kirupa.com/t/tween-thumbnail-scrolling-trouble-with-button-control/294209 "2009-08-10T21:50:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NewFormDesign](https://avatars.discourse-cdn.com/v4/letter/n/df705f/32.png) [@NewFormDesign](https://forum.kirupa.com/u/NewFormDesign)\
**Post date:** [August 10, 2009, 9:50pm UTC](https://forum.kirupa.com/t/tween-thumbnail-scrolling-trouble-with-button-control/294209/1 "2009-08-10T21:50:10Z")

</div>

Hi all, I’m a newbie, totally stuck, and would GREATLY appreciate any help on this. All I’ve been trying to do is to move a string of thumbnails - thumbHolder\_mc - incrementally (like every 386 pixels) left and right, controling it with arrow buttons. Code below works like a charm EXCEPT when I try to stop the tween motion on either end.  
I tried everything - \_visible = false, enabled = false, delete function, etc etc, nothing works. In the my script below, buttons get disabled, but never recover. Function never comes “back to life”, which is what I thought it was supposed to do:

stop();  
//connect right and left arrow buttons to function:  
abuttonright.onRelease = function() {  
tweenRight();  
}  
abuttonleft.onRelease = function() {  
tweenLeft();  
}

//create incremental movement forward:  
function tweenRight() {  
easeType = mx.transitions.easing.Strong.easeOut;  
var begin = thumbHolder\_mc.\_x;  
var end = thumbHolder\_mc.\_x -=386;  
var time = 1;  
var mc = thumbHolder\_mc;  
Tween = new mx.transitions.Tween(mc, “\_x”, easeType, begin, end, time, true);

//disable and dim button once the thumbnail reaches the end:  
if (thumbHolder\_mc.\_x \< 140) {  
delete abuttonright.onRelease;  
abuttonright.\_alpha = 30;  
}else{  
abuttonright.\_alpha = 100;  
}  
}

//create incremental movement backward:  
function tweenLeft() {  
easeType = mx.transitions.easing.Strong.easeOut;  
var begin = thumbHolder\_mc.\_x;  
var end = thumbHolder\_mc.\_x +=386;  
var time = 1;  
var mc = thumbHolder\_mc;  
Tween = new mx.transitions.Tween(mc, “\_x”, easeType, begin, end, time, true);

//disable and dim button once the thumbnail reaches the beginning:  
if (thumbHolder\_mc.\_x \> 140) {  
delete abuttonleft.onRelease;  
abuttonleft.\_alpha = 30;  
}else{  
abuttonleft.\_alpha = 100;  
}  
}

Would totally appreciate anyone’s ideas out of this snag!
