Fine tuning Snow fall
right now I have a particle engine that creates snow falling. It uses the whole stage (_root). I'm trying to get snow to fall in a specific movie clip so it only attaches, and removes the snowflake (particle) in a selected movieclip. I have a MC called widescreen_mc and inside that I have sky_mc. I would like the snow to fall in the sky_mc so you only see the snow in the screen. I've tried attaching it in the sky MC and then change the other stettings (width height) to adjust, but nothing I do works as expected. Here is the Prticle engine code i've been using. can anyone show/tell me the changes I need to make to get it to work (brief explanation of any code changes would be apprciated so I can see my mistkes.)
Merry Christmas
import mx.transitions.Tween;
import mx.transitions.easing.*;
timer = 0;
timermax = 10;
particleCount = 0;
gravity = .01;
changeOver = 100;
checker = true;
percipitation = function()
{
//this._x += -5;
this.yspeed += gravity;
this._y += this.yspeed;
if (this._y > (Stage.height))
{
this.removeMovieClip();
}
}
onEnterFrame = function ()
{
timer ++;
if (timer == timermax)
{
//generate particle
particle = _root.attachMovie("Snow","P_"+ particleCount, _root.getNextHighestDepth());
///needs to set random position across
particle._x = Math.floor(Math.random()*(1+Stage.width+3)) -3;
//particle._x = _xmouse;
particle._y = -10;
particle.xspeed = random (6) - 3;
particle.yspeed = random (6) - 0;
particle.thesize = random (100) + 10;
particle.fade = Math.floor(Math.random()*(1+50-10))+10;
particle._xscale = particle._yscale = particle.thesize
particle._alpha = particle.fade
particle.onEnterFrame = percipitation;
timer =0;
particleCount ++;
//trace(particleCount);
clock_mc.swapDepths(particle);
change_mc.swapDepths(clock_mc);
winter_mc.swapDepths(change_mc);
protect_mc.swapDepths(winter_mc);
holder_mc.swapDepths(protect_mc);
}
//}
}