# Continuous Scrolling Image w/ Cursor Control

**URL:** https://forum.kirupa.com/t/continuous-scrolling-image-w-cursor-control/149890
**Category:** flash
**Created:** [June 2, 2005, 12:50am UTC](https://forum.kirupa.com/t/continuous-scrolling-image-w-cursor-control/149890 "2005-06-02T00:50:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tranism](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/tranism/32/269_2.png) [@tranism](https://forum.kirupa.com/u/tranism)
#### Post date: [June 2, 2005, 12:50am UTC](https://forum.kirupa.com/t/continuous-scrolling-image-w-cursor-control/149890/1 "2005-06-02T00:50:31Z")

</div>

I’m using this code to loop a background image over and over so it looks like an infinite rolling background.

Okay now I’ve decided I want to control the actual movement (left or right) just by my cursor. Some intertia would be good too. 🙂

Anyone help?  
Here’s my code for the looping background

[AS]  
onClipEvent (load) {  
dummy\_mc.duplicateMovieClip(“dummy\_mc2”, 100);  
dummy\_mc2.\_x = dummy\_mc.\_x+dummy\_mc.\_width;  
groundStartx = this.\_x;  
groundSpeed = 1;  
}  
onClipEvent (enterFrame) {  
this.\_x -= groundSpeed;  
if (this.\_x\<=(groundStartx-dummy\_mc.\_width)) {  
this.\_x = groundStartx-groundSpeed;  
}  
}  
[/AS]
