wangbars script........
Get the feeling that snow effects are going to be the most common topic between now and Christmas?
Here's my version which you're welcome to grab, makes use of the duplicateMovieClip that Old mentioned...
It's all script so it's really easy to set up -
Make yourself a snowball, convert it to a movieClip, have two instances of it on the stage. Name one of them "flake", select the other one and attach these clipEvents:
onClipEvent (load) {
function radians (theta) {
return (theta/180*Math.PI);
}
function rand (value) {
return Math.floor(Math.random()*value)+1;
}
function init (mc) {
mc._x = rand(stageSize);
mc._y = rand(100)-100;
mc._xscale = mc._yscale=rand(30)+20;
mc.speed = rand(3);
mc.drift = rand(180)+90;
}
driftInc = 1;
stageSize = 550;
maxFlakes =25;
for (i=1; i<maxFlakes; i++) {
duplicateMovieClip (_root.flake, "snow"+i, i);
clip = _root["snow"+i];
init(clip);
}
}
onClipEvent (enterFrame) {
for (i=1; i<maxFlakes; i++) {
clip = _root["snow"+i];
if (clip.drift<270 && clip.drift>90) {
sweep = radians(clip.drift);
clip._x += Math.floor(1.2*Math.cos(sweep))+1;
} else {
driftInc *= -1;
}
clip.drift += driftInc;
clip._y += clip.speed;
if (clip._y>400) {
init(clip);
}
}
}
Every flake is unique (or close enough ...). Depending on the speed of your computer you can increase and decrease "maxFlakes" to get the amount of snow you're after. There are 25 flakes on the demo but my PC was reasonably happy to do 80-90 flakes as a rough guide...
carlsatterwhite@orlandomediasolutions.com