Код
function otskok() {
var rico:Number = new setInterval(ricoshet, 10);
function ricoshet() {
//
if (!earth.base.hitTest(obj_bullet._x, obj_bullet._y, true)) {
clearInterval(rico);
}
}
}
cannon.onRelease = function() {
var bullet_fly:Number = setInterval(bullet_flying, 10, canon);
function bullet_flying(canon) {
//
if (earth.base.hitTest(obj_bullet._x, obj_bullet._y, true) and earth.destroy.hitTest(obj_bullet._x, obj_bullet._y, true) == false and b_timer>0 and b_timer !== "none") {
clearInterval(bullet_fly);
otskok.call();
}
}
};
var rico:Number = new setInterval(ricoshet, 10);
function ricoshet() {
//
if (!earth.base.hitTest(obj_bullet._x, obj_bullet._y, true)) {
clearInterval(rico);
}
}
}
cannon.onRelease = function() {
var bullet_fly:Number = setInterval(bullet_flying, 10, canon);
function bullet_flying(canon) {
//
if (earth.base.hitTest(obj_bullet._x, obj_bullet._y, true) and earth.destroy.hitTest(obj_bullet._x, obj_bullet._y, true) == false and b_timer>0 and b_timer !== "none") {
clearInterval(bullet_fly);
otskok.call();
}
}
};
Как сделать, чтобы интервал rico очищался? Т.е. где косяк я примерно представляю, но исправить - не хватает толи знаний, толи умственных способностей...