ma questa è tutta un'altra cosa, anche io a suo tempo ho affrontato questo problemaOriginariamente inviato da zoc
Il mio goHome1 del setInterval non viene minimamente beccato per il clearInterval della funzione!!![]()
![]()
http://forum.html.it/forum/showthrea...ght=intervalID
ti dico subito che se passi l'intervalID come stringa non dovresti avere problemi a spegnerla con clearInterval(instanceName[interval]);
il tuo codice potrebbe assomigliare a questo
ps. ricorda che l'intervalID NON è un'istanza di MovieClip!codice:function Back (pos, interval) { pos.k += 1; trace (pos.k); if (pos.k == timeout) { pos.gotoAndPlay ("out"); pos.k = 0; trace (interval); clearInterval (_root[interval]); } } //---------------------------------- bt1.onRelease = function () { if (_root["goHome1"] != undefined) { clearInterval (_root["goHome1"]); } pos1.k = 0; _root.goHome1 = setInterval (Back, 1000, pos1, "goHome1"); pos1.play (); };

Rispondi quotando