Zombie-Survivor target finding?

So I have two arrays, survivors and zombehz, and I want elements from one (a survivor) to set an element from the other (a zombie) as its target, and to shoot said target until it dies.

Conversely, I want the zombies to find a survivor and hunt after them.

I can’t figure out how to make this work though.
Code below

Zombies:

if (Foe == false) {
            target = _root.Tracker.survivors[Math.ceil(Math.random()*_root.Tracker.survivors.length)];
            Foe == true;
        } else {
attack code (already tested)

Survivors:

if (Foe == false) {
            target = _root.Tracker.survivors[Math.ceil(Math.random()*_root.Tracker.survivors.length())];
            Foe == true;
        } else {
shooting code (already tested)

Can someone help me? And also, as an FYI, if I make a non-array based object that is directly controlled, it can shoot and kill zombies, but I can’t make them pick targets in the other arrays.