
main_init = function(mc){
 o = new Object();
 deg1 = deg360 / 360;
}

// main_effect function

main_effect = function(mc,frame){
 if (subs_done) end_effect = true;
}

// sub_init function

sub_init = function(mc){
 if (!out_effect) mc._alpha = 0;
}

// sub_effect function

sub_effect = function(mc,frame){
 perc = frame / lastsubframe;
 rp = 1-perc;
 if (out_effect) {
  perc = rp; rp = 1 - rp; 
  mc._alpha = 0;
 }  
 m = mc._parent;
 for (i=1;i<=parts;i++){
  a = deg360 * i / parts + rotation_angle * deg1 * rp;
  o._x = mc.__x - Math.cos(a) * distance * rp;
  o._y = mc.__y + Math.sin(a) * distance * rp;
  o._xscale = o._yscale = 100 + (outer_scale-100) * rp;
  o._alpha = perc * 100;
  if (char_rotation) o._rotation = ((out_effect ? -90 : 90) - 360 * i / parts) * (1-perc);
  mc.duplicateMovieClip("m"+i+"_"+mc._i,$sub_cnt*10 + $i*parts + i,o);
 }
 if (frame == lastsubframe) {
  for (i=1;i<=parts;i++){
   m["m"+i+"_"+mc._i].removeMovieClip(); 
  }
  if (!out_effect) mc._alpha = 100;
  mc.done = true;
 }
}

