Ciao a tutti! Ho 2 classi A e B che esteso da A.
Vorrei capire per quale motivo non mi funziona il metodo remove, mentre se imposto enabled con lostesso tipologia funziona. :master: :master: :master:
codice:
// Classe A
#initclip
function A()
{
this.attach();
this.ID = setInterval(this, 'removeB', 1000);
}
A.prototype = new MovieClip();
Object.registerClass('a', A);
A.prototype.livello = 1;
A.prototype.attach = function()
{
for (var a = 0; a < 3; a++)
{
this.attachMovie('b', 'b' + this.livello, this.livello, {_x:a * 50});
this.livello++;
}
};
A.prototype.remove = function()
{
trace('remove : ' + this._name);
this.removeMovieClip();
};
A.prototype.removeB = function()
{
trace('removeB');
A.prototype.enabled = false;
A.prototype.remove();
clearInterval(this.ID);
};
#endinitclip
//
//
//Classe B
#initclip 1
function B()
{
}
B.prototype = new A();
Object.registerClass('b', B);
B.prototype.onPress = function()
{
trace(this._name);
};
#endinitclip