# Object following mouse in masked area only

**URL:** <https://forum.kirupa.com/t/object-following-mouse-in-masked-area-only/177724>\
**Category:** flash\
**Created:** [February 4, 2006, 4:42pm UTC](https://forum.kirupa.com/t/object-following-mouse-in-masked-area-only/177724 "2006-02-04T16:42:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wisse](https://avatars.discourse-cdn.com/v4/letter/w/ee7513/32.png) [@Wisse](https://forum.kirupa.com/u/Wisse)\
**Post date:** [February 4, 2006, 4:42pm UTC](https://forum.kirupa.com/t/object-following-mouse-in-masked-area-only/177724/1 "2006-02-04T16:42:26Z")

</div>

I’m sorry to bug you but i’m flash noob trying to learn smth and i want to ask you a thing or twho here till i get my book.

[http://freeweb.siol.net/tomaztr/default.html](http://freeweb.siol.net/tomaztr/default.html)  
here’s the page i’m working on (with no comercial intentions) and i didn’t have much problem making simple animations, but now i need to do lil action scripting and that’s where i suck the most :diss:.

I want you to concentrate on that yellow piece of paper behind the hole, with smth written on it. If you move your mouse you can see what i had in mind, but now i would like to limit that action in masked area only, or if that’s too complicated i just want to limit action for certain \_ymouse (for example only from 100 to 200 pixels)

```auto
mouseInterval = setInterval(premik, 10);

function premik() {
    papir._y = _root._ymouse/5-10^(-1)
    papir._x = _root._xmouse/15+5^(-1)
}

```

Here’s what i made from that magic mouse toturial and couldn’t find any solution to my problem in hours of trying.  
Thanks for helping and i’m terribly sorry if i made similar topic to any existing.

Wisse

p.s. do you recomend any good book where i can learn flash from?
