# Scroll dynamic image based on xmouse and ymouse

**URL:** https://forum.kirupa.com/t/scroll-dynamic-image-based-on-xmouse-and-ymouse/183295
**Category:** Uncategorized
**Created:** [March 25, 2006, 4:45pm UTC](https://forum.kirupa.com/t/scroll-dynamic-image-based-on-xmouse-and-ymouse/183295 "2006-03-25T16:45:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![liquify](https://avatars.discourse-cdn.com/v4/letter/l/e95f7d/32.png) [@liquify](https://forum.kirupa.com/u/liquify)
#### Post date: [March 25, 2006, 4:45pm UTC](https://forum.kirupa.com/t/scroll-dynamic-image-based-on-xmouse-and-ymouse/183295/1 "2006-03-25T16:45:44Z")

</div>

Hi,

I’m trying to change kirupa’s xml gallery to scroll the foto on rollover based on xmouse and ymouse .

here is what im trying to do:  
[http://www.soromenho.net/thumbnail/thumbnail\_final2.swf](http://www.soromenho.net/thumbnail/thumbnail_final2.swf)

of course something is wrong… 😊

can anyone please help me?

here are the files: [http://www.soromenho.net/thumbnail/thumbnail2.zip](http://www.soromenho.net/thumbnail/thumbnail2.zip)

thank you so much

---

<div class="post-metadata">

### Author: ![liquify](https://avatars.discourse-cdn.com/v4/letter/l/e95f7d/32.png) [@liquify](https://forum.kirupa.com/u/liquify)
#### Post date: [March 25, 2006, 8:45pm UTC](https://forum.kirupa.com/t/scroll-dynamic-image-based-on-xmouse-and-ymouse/183295/2 "2006-03-25T20:45:56Z")

</div>

Nevermind 🙂

in the “picture” movie clip just used

```auto

onClipEvent (load) {
	destX = _x;
	destY = _y;
}

onClipEvent (enterFrame) {
	picW = this._width;
	picH = this._height;
	if (picW>300) {
		posH = picW-320;
		posV = picH-220;
		destX = -_parent._xmouse*posH/300;
		destY = -_parent._ymouse*posV/220;
		if (destX>0) {
			destX = 0;
		}
		if (destX<-posH) {
			destX = -posH;
		}
		if (destY>0) {
			destY = 0;
		}
		if (destY<-posV) {
			destY = -posV;
		}
	
	_x = _x+(destX-_x)*0.100000;
	_y = _y+(destY-_y)*0.100000;
}
}

```

and its all working fine 🙂
