# Refracting Mask

**URL:** https://forum.kirupa.com/t/refracting-mask/148645
**Category:** Uncategorized
**Created:** [May 21, 2005, 11:46pm UTC](https://forum.kirupa.com/t/refracting-mask/148645 "2005-05-21T23:46:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![The80sKickAss](https://avatars.discourse-cdn.com/v4/letter/t/4bbf92/32.png) [@The80sKickAss](https://forum.kirupa.com/u/The80sKickAss)
#### Post date: [May 21, 2005, 11:46pm UTC](https://forum.kirupa.com/t/refracting-mask/148645/1 "2005-05-21T23:46:34Z")

</div>

OK, so i dont know much about Action Scripting but what I’m trying to do is get a Magnifying mask effect to take up the whole screen and be able to animate the object under it. I dont want it to be interactive, I just want to keep the magnifying mask stationary.

I found this script online. but i dont know how to manipulate it to do what i want. Any help would be greatly appreciated thank you -Tim

onClipEvent (load) {  
Mouse.hide()  
mag = 200; // the default magnification (100 = 1x)  
total = 25; // how many masks should be used to make this effect  
final = 40; // the diameter of the final mask should be this percentage of the full size  
glare.swapDepths(total+1)  
// this loop creates the masks that make up the effect  
for (var i = 1; i\<=total; i++) {  
duplicateMovieClip (g0, “g”+i, i);  
// this variable represents the increment by which each mask needs to be resized  
scale = (100-final)/total;  
with (eval(“g”+i)) {  
\_yscale = 100-(scale\*i);  
\_xscale = \_yscale  
}  
}  
}

onClipEvent (enterFrame) {  
// you can either use these two lines or startDrag(),  
// but this way won’t interefere with other drag operations  
\_x = \_root.\_xmouse  
\_y = \_root.\_ymouse  
// these are the controls for the magnification.  
// I put them here instead of in a button to keep things together,  
// as well as bypassing some of the unfortunate problem with keys as button triggers  
if (Key.isDown(Key.UP) && mag\<500) {  
Mag += 10;  
}  
if (Key.isDown(Key.DOWN) && mag\>110) {  
Mag -= 10;  
}  
// this loop goes through each of the mask movies and does the following:  
// \* adjusts the scale of the picture based on Mag  
// \* adjusts the position of the oicture based on the mouse position  
for (var i = 0; i\<=total; i++) {  
with (eval(“g”+i+".p")) {  
offset = (mag-100)/(total+1);  
\_yscale = (((offset_i)+100)/\_parent.\_yscale)100;  
\_xscale = \_yscale;  
\_x = -\_root.original.\_xmouse(\_xscale/100);  
\_y = -\_root.original.\_ymouse_(\_yscale/100);  
}  
}  
}
