# Movie clip to move with mouse direction

**URL:** https://forum.kirupa.com/t/movie-clip-to-move-with-mouse-direction/261982
**Category:** Uncategorized
**Created:** [June 2, 2008, 12:10pm UTC](https://forum.kirupa.com/t/movie-clip-to-move-with-mouse-direction/261982 "2008-06-02T12:10:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jikowhitewolf](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@jikowhitewolf](https://forum.kirupa.com/u/jikowhitewolf)
#### Post date: [June 2, 2008, 12:10pm UTC](https://forum.kirupa.com/t/movie-clip-to-move-with-mouse-direction/261982/1 "2008-06-02T12:10:30Z")

</div>

Hi  
I am new to this forum, wish to seek some advices how to create a movable screen when mouse is pointing at left or right of the screen.

I am working on a feature, that when my mouse is near to the left, the movie clip will drag toward the left until the end of the scroll.

Thanks in advance

---

<div class="post-metadata">

### Author: ![jon\_bla](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jon\_bla](https://forum.kirupa.com/u/jon_bla)
#### Post date: [June 2, 2008, 1:25pm UTC](https://forum.kirupa.com/t/movie-clip-to-move-with-mouse-direction/261982/2 "2008-06-02T13:25:16Z")

</div>

you cant actually move the stage but you can move a movieclip.  
u can do something like this

```auto

// u can use setInterval too... I am used to this

onEnterFrame = function () {
	
	if(_root._xmouse >400){ // change 400 to the number u want (max)
		my_mc._x -=10;
	}else	if(_root._xmouse <100){ // change 100 to the number u want (min)
		my_mc._x +=10;
	}
}

```

---

<div class="post-metadata">

### Author: ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)
#### Post date: [June 2, 2008, 1:55pm UTC](https://forum.kirupa.com/t/movie-clip-to-move-with-mouse-direction/261982/3 "2008-06-02T13:55:26Z")

</div>

theres a tutorial on the main page simlar to what you are looking for

also the top link my sig has a tut on this kind of thing
