actionscript 3 - AS3 How to remove object from array -
i have array called 'body_stat_array' , in array holds object called 'body_stat'. array needs increase decrease in size time, how remove last object array, here example doesn't work
if(body_stat_array.length > target_size)
{ body_stat_array.slice(body_stat_array.indexof(body_stat_array[body_stat_array.length-1]),1) // line above should remove last object in array }
so going wrong, how make work.
if can help, love find out.
the easiest way remove last object array call pop:
body_stat_array.pop();
Comments
Post a Comment