# Moving a mask

**URL:** <https://forum.kirupa.com/t/moving-a-mask/95022>\
**Category:** Uncategorized\
**Created:** [November 19, 2003, 4:39pm UTC](https://forum.kirupa.com/t/moving-a-mask/95022 "2003-11-19T16:39:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![riderchic88](https://avatars.discourse-cdn.com/v4/letter/r/77aa72/32.png) [@riderchic88](https://forum.kirupa.com/u/riderchic88)\
**Post date:** [November 19, 2003, 4:39pm UTC](https://forum.kirupa.com/t/moving-a-mask/95022/1 "2003-11-19T16:39:43Z")

</div>

Hey all,

I’m using masking moved by actionscript to accomplish a panning effect on an automatic slideshow. How, if I’m using this script:  
[AS]onClipEvent (enterFrame) {  
choice = Math.round(Math.random()\*0);  
switch (choice) {  
case 0 :  
this.\_x = \_x + 25;  
if (this.\_x\>= 360){  
this.\_x = -360;  
}  
}  
}[/AS]  
do I get it to move across the stage (from -360 to 360) in a certain amount of time? The photos are changing at a speed of 25 (I’m guessing that means frames, I’m a newbie when it comes to action script), so I’d like the mask to move at the same rate.

Thanks in advance, you guys are great :nerd:

PS - there will be other cases, as soon as I figure this one out 😉
