
// main_init function

main_init = function(mc){
 subs_done = true;
 i1 = new flash.display.BitmapData(mc._width,mc._height,0,0x808080);
 i2 = i1.clone();
 perlin ? i2.perlinNoise(base_x,base_y,octaves,new Date(),0,1,6) : i2.noise(new Date());
 filter = [new flash.filters.DisplacementMapFilter(i1,i1.rectangle.topLeft,4,2,disp_x*2,disp_y*2,'color')];
 if (!out_effect) mc._alpha = 0;
}



// main_effect function

main_effect = function(mc,frame){
 p = frame / lastsubframe;
 if (!out_effect) p = 1 - p;
 i1.fillRect(i1.rectangle,0x80808080);
 i1.merge(i2,i2.rectangle,i2.rectangle.topLeft,0,p*256,p*256);
 mc.filters = filter;
 mc._alpha = 100-p*100;
 if (scaling) mc._xscale = mc._yscale = mc._alpha;
 if (frame == lastsubframe){
  mc.filters = undefined;
  end_effect = true;
  i2.dispose();
  i1.dispose();
 }
}



// sub_init function

sub_init = function(mc){
}



// sub_effect function

sub_effect = function(mc,frame){
}
