PDA

View Full Version : Data Flow Effect (Like Snow)



ALPHA
September 20th, 2003, 10:28 PM
I wish to create a data flow effect as a background to a preloader, the only problem is I can't get the effect correct.

I wish to make it look like the Kirupa Snow Effect (http://www.kirupa.com/developer/mx/snow.htm) except it snows horizontally to the right.

------------------------> This way

I also would like the data to flow straight not sway like the snow, and each movie clip needs to be a random colour out of those on the attached image.

The data should be randomly sized, and placed like the snow. If anybody is able to help me and provide it as a source file it would be greatly appreciated.


Thanks in advance!

jingman
September 20th, 2003, 11:56 PM
What exactly do you mean by "data"?

The snow code should be pretty easily modified to flow to the right (check spawn points - change them to x=0 and not y=0, check direction modifiers - change y++ to x++)

ALPHA
September 21st, 2003, 12:08 AM
Oh data flow, each square would represent like a bit or a byte and it would look like it was flowing along as the page was loading, if you don't get it never mind, just think it of it as horizontal rain/snow.

Thanks or the help, I'll reply if I can't get it to work, and does anybody know about the random three colours?

jingman
September 21st, 2003, 12:15 AM
inside the data mc:


var picker = random(3);

switch(picker){
case 0: newColor = 0x3399FF;
break;
case 1: newColor = 0x66CC00;
break;
case 2: newColor = 0xFFCC00;
break;
}

mcColor = new Color(this);
mcColor.setRGB(newColor);

ALPHA
September 21st, 2003, 12:30 AM
Thanks for the help I got it to go horizontally but I'm not sure if I have made the code 100% efficient or if I have just fluffed everything up.

onClipEvent (load) {
var picker = random(3);
switch(picker){
case 0: newColor = 0x3399FF;
break;
case 1: newColor = 0x66CC00;
break;
case 2: newColor = 0xFFCC00;
break;
}
mcColor = new Color(this);
mcColor.setRGB(newColor);

//specifies the size of the movie stage
movieWidth = 300;
movieHeight = 200;

//variables that will modify the falling snow
i = 1+Math.random()*2;
k = -Math.PI+Math.random()*Math.PI;

//giving each snowflake unique characteristics
this._xscale = this._yscale=50+Math.random()*100;
this._alpha = 75+Math.random()*100;
this._x = -10+Math.random()*movieWidth;
this._y = -10+Math.random()*movieHeight;
}
onClipEvent (enterFrame) {
//putting it all together
rad += (k/180)*Math.PI;
this._x -= Math.cos(rad);
this._x += i;
if (this._x>=movieWidth) {
this._x = 5;
}
if ((this._y>=movieHeight) || (this._y<=0)) {
this._y = -10+Math.random()*movieHeight;
this._y = 5;
}
}

All I wish now is to make the code so that it can appear behind layers not acting as though it's ontop of everything and seeing if I can position the random rendering in a set of dimensions in a movie.

EDIT:
I found this code:


picture_mc.swapDepths(10000);//picture_mc is the instance name for your movie clip
I changed to:
snow.swapDepths(10000);
And placed it on the layer with the actions and with the snow mc just to see what one it needed it on and I can't get the code doesn't work, what have I done wrong this time?

jingman
September 21st, 2003, 09:36 PM
well that code is for putting objects on top of everything (1000 is really "high").

What I would do in your case is attach/duplicate all these 'snow data' mcs in an empty clip that you just put on a low layer.

ALPHA
September 21st, 2003, 11:25 PM
I got that depths thing working and that's all sweet, is the higher the number the higher above all the other objects?