Пытаюсь сделать свою компоненту Grid - табличку для любых данных.
Внутри компонента создаю текстовые поля - ячейки таблицы. Поля создаются. Теперь специальной функцие пытаюсь очистить компонент от внутренностей - удаляю эти динамические поля.... и никак. Вот код:

Код:
#initclip
Grid.prototype = new MovieClip();
// конструктор
function Grid()
{
trace("tres bien");
//this.Draw();
}
Grid.prototype.colCount = 5;
Grid.prototype.rowCount = 5;
Grid.prototype.depth = 0;
Grid.prototype.Draw = function()
{
this.Clear();
for(var i = 0; i < this.colCount; i++)
{
for(var j = 0; j < this.rowCount; j++)
{
this.createTextField("cell" + i + j, this.depth++, j*50, i*25, 50, 25);
this["cell" + i + j].border = true;
this["cell" + i + j].selectable = false;
this["cell" + i + j].text = "cell" + i + j;
this["cell" + i + j].borderColor = 0xFFFFFF;
this["cell" + i + j].background = true;
this["cell" + i + j].backgroundColor = 0x75E336;
this["cell" + i + j].textColor = 0xFFFFFF;
}
}
}
Grid.prototype.Clear()
{
for(var i = 0; i < this.colCount; i++)
{
for(var j = 0; i < this.rowCount; i++)
{
this["cell" + i + j].removeTextField();
}
}
this.depth = 0;
}
Object.registerClass("Grid", Grid);
#endinitclip
Я так понял, что из метода Grid.Clear() мои текстовые поля совершенно не видны. Как лучше сделать не подскажите?
Большое спасибо