# Scrolling mask

**URL:** <https://forum.kirupa.com/t/scrolling-mask/256149>\
**Category:** Uncategorized\
**Created:** [March 31, 2008, 11:02am UTC](https://forum.kirupa.com/t/scrolling-mask/256149 "2008-03-31T11:02:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![leukocyt](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@leukocyt](https://forum.kirupa.com/u/leukocyt)\
**Post date:** [March 31, 2008, 11:02am UTC](https://forum.kirupa.com/t/scrolling-mask/256149/1 "2008-03-31T11:02:38Z")

</div>

Hello,

Here is my problem.  
I have a movie clip to which I load thumbnails form an XML file. This MC is under a mask that is used to scroll those thumbails horizontaly.  
The code looks like this:

var center = Stage.width/2;  
var speed = .015;  
function activateMenu() {  
menu.onEnterFrame = function() {  
var distance = \_root.\_xmouse-center;  
if (maska.hitTest(\_root.\_xmouse, \_root.\_ymouse)) {  
this.\_x += (distance\*speed);  
if (this.\_x\<-sub\_menu.\_width/2) {  
this.\_x = 0;  
}  
if (this.\_x\>0) {  
this.\_x = -sub\_menu.\_width/2;  
}  
}  
};  
}

It works fine untill I publish the movie in such a way that it uses the entire browser window and is centered. When I do the the center of the stage seems to be more to the right for some reason and the scrolling is much faster if I move the mouse pointer to the left than when I move it to the right (and stops on the right side of the thumbnails instead of stoping in the middle).

I imagine it has something to do with the first line of the code, but I don’t know how to counteract the effect.

Also, is there a way to scroll the thumbs under the mask with a left and right buttons instead of using mouse position?

Thanks in advance for any info you guys can provide.

---

<div class="post-metadata">

**Author:** ![leukocyt](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@leukocyt](https://forum.kirupa.com/u/leukocyt)\
**Post date:** [May 9, 2008, 3:01pm UTC](https://forum.kirupa.com/t/scrolling-mask/256149/2 "2008-05-09T15:01:44Z")

</div>

It turns out that this uneven scrolling is caused by HTML scaling options when the movie is published. When it’s set to “No Scale” the problem is present. When I set it to “Default” it works ok, but the movie is distorted.

I really need it to be a full browser website, so I have to set it to no scale + 100% x 100% browser size.  
I don’t know if there is a way to work around the issue. Only thing that I can think of would be using scrolling buttons instead of mouse position, but I don’t know how to do it.  
Any ideas? 🙂
