Scripting a Snowflake Mask

How could I modify this code to keep the flakes from falling within 12px on all four sides plus a 22 radius on the corners. I could just load the swf into a master file to accomplish this but it’s gonna be such a simple piece I was hoping there could be a way to just use code to do it. Also, this AS only works as 1.0 and Flash Player 6. Any clue how to upgrade it?


// snowflakes
amount = 100;
mWidth = Stage.width;
mHeight = Stage.height;
for (var i = 0; i<amount; i++) {
	thisFlake = this.attachMovie("flake", "flake"+i, i);
	with (thisFlake) {
		_x = Math.random()*mWidth;
		_y = Math.random()*mHeight;
		_xscale = _yscale=_alpha=40+Math.random()*60;
	}
	thisFlake.yspeed = Math.random()*2+.2;
	thisFlake.increment = -0.025+Math.random()*0.05;
	thisFlake.radian = 0; //declare for actionscript 2.0
	thisFlake.onEnterFrame = function() {
		this.radians += this.increment;
		//trace(this.radians);
		this._x += Math.sin(this.radians);
		this._y += this.yspeed;
		if (this._y>=mHeight) {
			this._y = -10;
			this._x = -10+Math.random()*mWidth;
		}
		if (this._x>=mWidth || this._x<=0) {
			this._y = -10;
			this._x = -10+Math.random()*mWidth;
		}
	};
}