# Masking snow AS

**URL:** https://forum.kirupa.com/t/masking-snow-as/271074
**Category:** flash
**Created:** [September 18, 2008, 2:44am UTC](https://forum.kirupa.com/t/masking-snow-as/271074 "2008-09-18T02:44:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Floydtopia](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@Floydtopia](https://forum.kirupa.com/u/Floydtopia)
#### Post date: [September 18, 2008, 2:44am UTC](https://forum.kirupa.com/t/masking-snow-as/271074/1 "2008-09-18T02:44:41Z")

</div>

I’m still new to Flash and I have been unable to get this effect to work. I am using the snow actionscript found in the tutorial [http://www.kirupa.com/developer/flash8/snow.htm](http://www.kirupa.com/developer/flash8/snow.htm)  
The actionscript for it is  
[INDENT] init = function () { width = 300; // pixels height = 200; // pixels max\_snowsize = 10; // pixels snowflakes = 50; // quantity for (i=0; i\<snowflakes; i++) { t = attachMovie(“snow”, “snow”+i, i); t.\_alpha = 20+Math.random()_60; t.\_x = -(width/2)+Math.random()_(1.5_width); t.\_y = -(height/2)+Math.random()_(1.5_height); t.\_xscale = t.\_yscale=50+Math.random()_(max\_snowsize_10); t.k = 1+Math.random()2; t.wind = -1.5+Math.random()(1.4_3); t.onEnterFrame = mover;}}; mover = function() { this.\_y += this.k; this.\_x += this.wind; if (this.\_y\>height+10) { this.\_y = -20;} if (this.\_x\>width+20) { this.\_x = -(width/2)+Math.random()_(1.5_width); this.\_y = -20;} else if (this.\_x\<-20) { this.\_x = -(width/2)+Math.random()_(1.5_width); this.\_y = -20;}} init(); [/INDENT]How can I add a mask to the flash so that the snow only falls behind the mask such as behind text? I have not been able to locate a topic that covers this and everything I have tried has not worked
