# Scrolling bar with images

**URL:** https://forum.kirupa.com/t/scrolling-bar-with-images/78278
**Category:** flash
**Created:** [February 3, 2005, 9:10am UTC](https://forum.kirupa.com/t/scrolling-bar-with-images/78278 "2005-02-03T09:10:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rykong196](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@rykong196](https://forum.kirupa.com/u/rykong196)
#### Post date: [February 3, 2005, 9:10am UTC](https://forum.kirupa.com/t/scrolling-bar-with-images/78278/1 "2005-02-03T09:10:47Z")

</div>

Hi!

I’m having trouble with a scrolling image bar. Below is the code

onClipEvent (enterFrame) {  
direction = ((-247-\_root.\_xmouse)/25);

if ( ((this.\_x\>=403) && (direction \> 0)) || ((this.\_x\<=-873)&&(direction\<0)) ) {

direction = 0;  
}  
this.\_x = this.\_x+direction;  
}

I have problems with line 2 of the code, whereby:  
direction=((-247-\_root.\_xmouse)/25); meaning that -247 does not work, wherby if I placed a positive number, say 2, it will work. Unfortunately, it is a series of images , like a photo gallery, so it is very long, and the centre position of the clip is a negative position, at -247. Is there a way to rectify this problem as I’m not too good with programming and got this script off from somewhere.
