petit soucis avec setinterval()
bonjour,
je suis en train de travailler sur un petit projet de casse-brique avec d'autre personne. (les logiciels utilisés sont Mtasc et e-anim)
je coince avec la création d'un "timer" qui réalise une petit animation de destruction de pièce.
le code en question
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
static function init_anim(pce:MovieClip) {
pce.dp = new Number;
pce.fn_dep =function() {
this.cpt++;
this.HG._x--;
this.HG._y--;
this.HG._alpha-=6.66;
this.HD._x++;
this.HD._y--;
this.HD._alpha-=6.66;
this.BG._x--;
this.BG._y++;
this.BG._alpha-=6.66;
this.BD._x++;
this.BD._y++;
this.BD._alpha-=6.66;
if (this.cpt>=15) {
this.removeMovieClip();
clearInterval(pce.dep);
}
}
pce.go = function() {
pce.cpt=0;
pce.dp=setInterval(pce.fn_dep,20);
}
} |
la fonction "fn_dep()" marche sans soucis , mais la fonction "go()" elle ne declenche pas le "timer"
es ce que je fais une erreur en initialisant le timer ?
merci de votre aide