Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add a scene

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
i have a snow loop scene were the snow keeps falling,
but when i add a text for snow to fall on it, i add the snow and it blinks. does someone no how to make snow land on text, thank you
 
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, &quot;snow&quot;+i, i);
clip = _root[&quot;snow&quot;+i];
init(clip);
}
}
onClipEvent (enterFrame) {

for (i=1; i<maxFlakes; i++) {
clip = _root[&quot;snow&quot;+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 &quot;maxFlakes&quot; 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...
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
here i got your e-mail..the rest of this thread has another link..wangbar made the snow pile up on the ground..just modify the script to make the ground your text..

logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top