# MouseDown scrolling problem

**URL:** <https://forum.kirupa.com/t/mousedown-scrolling-problem/17747>\
**Category:** flash\
**Created:** [April 8, 2003, 8:51pm UTC](https://forum.kirupa.com/t/mousedown-scrolling-problem/17747 "2003-04-08T20:51:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dshallenberger](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@dshallenberger](https://forum.kirupa.com/u/dshallenberger)\
**Post date:** [April 8, 2003, 8:51pm UTC](https://forum.kirupa.com/t/mousedown-scrolling-problem/17747/1 "2003-04-08T20:51:35Z")

</div>

I’m new to flash and this forum. I’m using Flash MX on a Mac in my studio. I come from a background of PHP programming, so that seems to help with learning Actionscript, but not with the particulars of Flash.

I have a client that needs a scrollable panaramic image, somewhat like what you see in Quicktime VR, only more simple (only left - right scroll, no zooming). I found a tutorial here that got me started with the left-right scroll when the mouse enters the live area, and even modified the script to accelerate/decelerate. But, what I really want is to be able move the cursor into the live area, but nothing happens until you click and drag. Then, when the mouse button is down, and you move left or right, the image scrolls (similar to Quicktime).

My script now starts with ‘onClipEvent(enterFrame)’. I tried ‘onClipEvent(MouseDown)’ but then the scrolling only works when you click and release. Can anyone help me with this? I’ve searched for tutorials, and all I can find is ‘startDrag’ and such, but I couldn’t figure out how to make that work. Here’s my current code, starting with the ‘infinite\_start’ tutorial found on this site:

[AS]  
onClipEvent (enterFrame) {  
if (\_root.\_xmouse \< 20 || \_root.\_xmouse \> 280 || \_root.\_ymouse \< 20 || \_root.\_ymouse \> 130) { // mouse position is OUTSIDE the live area  
decel = decel - decel\_amount; // create a deceleration value  
if (decel \< 0) { // keep the deceleration value at 0 so the movement doesn’t reverse  
decel = 0;  
}  
} else { // mouse position is INSIDE the live area  
decel = decel + decel\_amount;  
if (decel \> 1) {  
decel = 1;  
}  
}  
var xdistance = (\_root.\_xmouse-xcenter)_decel; // how far to move the movie clip  
\_x -= (xdistance_xspeed); // actually reposition the movie clip  
if (\_x \> 0) { // test is the movie clip needs to loop  
\_x = -300;  
}  
if (\_x \< -300) { // test is the movie clip needs to loop  
\_x = 0;  
}  
}  
[/AS]

Thanks very much,  
Dan
