Adding/Removing objects to/from an array based on a variable?

So a small example of my situation…On my stage I have 5 items labeled item1_mc, item2_mc, item3_mc and so forth…they all have two keyframes on their respective timelines, one labeled “active” and the other “inactive”. My code contains 2 arrays, inactiveArray and activeArray and a variable known as energy that regularly goes to and from 0 - 100.

What I am looking to achieve is basically the function of…

if energy >= “insert given items ‘active threshold’ 20, 40, 60, etc…” then add it to the activeArray, if it is not, remove it and add it to the inactive array.

all objects in activeArray gotoAndStop(“active”);

all objects in inactiveArray gotoAndStop(“inactive”);

I have tried many different ways of achieving this effect but I always end up with duplicates and extras or something doesn’t move when it’s supposed to, where it’s supposed to, it just ends up into a giant cluttered mess and I start from scratch.

I really dislike “giving up” but I am completely stumped and really need help with this one…any and all assistance will be very very VERY appreciated!