you destroy the hud[i] here, hud[i] is now undefined and size is decreasedPHP Code:
self.txt_hud[i] destroy();
self.txt_hud[i].name = undefined;
however you set hud[i].name afterwards to undefined, therefore hud[i] is now more or less defined
(since it holds the undefined membervariable name)
should do the trick, there is no need to set it to undefinedPHP Code:
self.txt_hud[i] destroy();