# Button event - something like on (hold)?

**URL:** <https://forum.kirupa.com/t/button-event-something-like-on-hold/222726>\
**Category:** Uncategorized\
**Created:** [April 16, 2007, 4:00pm UTC](https://forum.kirupa.com/t/button-event-something-like-on-hold/222726 "2007-04-16T16:00:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![grenouille](https://avatars.discourse-cdn.com/v4/letter/g/f6c823/32.png) [@grenouille](https://forum.kirupa.com/u/grenouille)\
**Post date:** [April 16, 2007, 4:00pm UTC](https://forum.kirupa.com/t/button-event-something-like-on-hold/222726/1 "2007-04-16T16:00:36Z")

</div>

Hi,

I created a movieclip containing a button. I wrote an actionscript for this button. When it is clicked, a movieclip containing some thumbnails is scrolled to the left.

This is the code :

```auto

on (press) {
 lxposthumbs = thumbs_mc._x + thumbs_mc._width;
 lxposmask = thumbs_mask._x + thumbs_mask._width;
 if (lxposthumbs >= lxposmask)
 {
  pos = thumbs_mc._x - 75;
  _global.posit = _global.posit - 75;
  thumbs_mc.tween("_x",pos,0.35,"easeInOutQuad");
 }
}

```

What I would like is when I hold my mouse button down on the button, the thumbnails keep on scrolling. How do I do this? Something like an “on (hold)” is what I need.

Thnx in advance,

Grenouille
