// --- 8< --- 8< --- CONFIGURE HERE --- 8< --- 8< --- // How many flakes to be rendered (In one block). var snow_amount = 150; // How many times the rendered block will be repeated to the right. // This is mainly a feature for PCU optimization. The higher the // number, the lower you can set the snow_amount and therefore save // CPU usage. (The copying is much less CPU consuming than the // flakes rendering) If you dont want any repeation, set this to 0. var snow_repeat = 2; // The size of the snow field. If you want the snow to be // restricted to a smaller field than the size of your (root) // movie, replace the "Stage.width" and "Stage.height" commands // with the width and height you want to use. Otherwise leave them. var snow_stage_width = Stage.width; var snow_stage_height = Stage.height; // --- 8< --- 8< --- STOP --- 8< --- 8< --- import flash.display.BitmapData; import flash.geom.Matrix; import flash.geom.Rectangle; snow_repeat += 1; var snow_width = snow_stage_width/snow_repeat; var snow_height = snow_stage_height; var snow_flakes = []; this.createEmptyMovieClip("snow_source_block",this.getNextHighestDepth()); snow_source_block.createEmptyMovieClip("snow_flake",snow_source_block.getNextHighestDepth()); snow_source_block.snow_flake._y = -100; snow_source_block.snow_flake.lineStyle(1,0xffffffff,0); snow_source_block.snow_flake.beginFill(0xffffffff); snow_source_block.snow_flake.moveTo(0,4); snow_source_block.snow_flake.curveTo(.7,7.3,4,8); snow_source_block.snow_flake.curveTo(7.3,7.3,8,4); snow_source_block.snow_flake.curveTo(7.3,.7,4,0); snow_source_block.snow_flake.curveTo(.7,.7,0,4); snow_source_block.snow_flake.endFill(); if (snow_repeat>1) { var snow_duplicate = new BitmapData(snow_width+200, snow_height, true, 0x00FFFFFF); for (var i = 1; i=snow_height) { snow_flakes[i]._y = -10; snow_flakes[i]._x = Math.random()*snow_width; snow_flakes[i].radians = 0; } } if (snow_repeat>1) { snow_duplicate.fillRect(new Rectangle(0, 0, snow_width+200, snow_height),0x00000000); snow_duplicate.draw(snow_source_block,new Matrix(1, 0, 0, 1, 100, 0),null,1); } };