Code works in for Flash 6 but not 7

this.onEnterFrame = function() {
 i = i+1;
 clip = this.createEmptyMovieClip("eqbar"+i, i);
 this.clip._x = 0;
 this.clip._y = 0;
 with (this.clip) {
  lineStyle(1, 0xCCCCCC, 20);
  for (var j = 0; j<10; j++) {
   z = int(Math.random()*8+5);
   beginFill(0x222222, 30);
   moveto((j*6), 0);
   lineto((j*6), (0-z));
   lineto((3+j*6), (0-z));
   lineto((3+j*6), 0);
   lineto((i*6), 0);
   endFill();
  }
  if (i == 3) {
   i = 0;
  }
 }
};

This code works fine when published in Flash6. However, when I publish in Flash 7 I don’t see anything. Any ideas?