
main_init = function(mc){
 b = mc.getBounds(); subs_done = true;
 p = padding - $padding/2; ht = thickness / 2;
 li = b.xMin - p; ti = b.yMin - p;
 ri = b.xMax + p; bi = b.yMax + p;
 lo = li - thickness; to = ti - thickness;
 ro = ri + thickness; bo = bi + thickness;
 lm = li - ht; tm = ti - ht;
 rm = ri + ht; bm = bi + ht;

 colors = [ color1, color2 ];
 ratios = [ 0, 255 ];
 alphas = [ alpha1, alpha2 ];
 matrix = { matrixType:"box", w:ro-lo, h:bo-to, x:lo, y:to }
 matrix.r = initial_angle*deg360/360;

 createEmptyMovieClip("f",6); // basic frame
 createEmptyMovieClip("m",7); // mask for basic frame
 createEmptyMovieClip("h",8); // layer for non moving top frame

 f.setMask(m);
 f.boxEndFill = function(l,t,r,b){
  this.moveTo(l,t);
  this.lineTo(r,t);
  this.lineTo(r,b);
  this.lineTo(l,b);
  this.endFill();
 }

 m.lineStyle();
 m.beginFill(-1);
 m.moveTo(lo,to);
 m.lineTo(ro,to);
 m.lineTo(ro,bo);
 m.lineTo(lo,bo);
 m.lineTo(lo,to);
 m.lineTo(li,ti);
 m.lineTo(li,bi);
 m.lineTo(ri,bi);
 m.lineTo(ri,ti);
 m.lineTo(li,ti);
 m.endFill();

 h.box = function(l,t,r,b,th,co,al){
  this.lineStyle(th,co,al);
  this.moveTo(l,t);
  this.lineTo(r,t);
  this.lineTo(r,b);
  this.lineTo(l,b);
  this.lineTo(l,t);
 }
 if (alpha3>0){
  for (i=10; i>0; i--) h.box(lm,tm,rm,bm,i/10*thickness,color3,alpha3-alpha3*i/10);
 }

}

// main_effect function

main_effect = function(mc,frame){

 matrix.r += 0.0157 * rotation_speed;

 f.clear();
 f.beginGradientFill( "linear", colors, alphas, ratios, matrix );
 f.boxEndFill(lo,to,ro,bo);

}

// sub_init function

sub_init = function(mc){
}

// sub_effect function

sub_effect = function(mc,frame){
}

