Detect broken image links before loading on stage

I’ve just finished a flash projector for my company’s lobby that displays all members of the staff in a dynamically generated grid with a page for each department. Flash reads an xml file generated from our Active Directory using php.

I’ve just discovered a bug. We have several employees that don’t wish to have their images displayed; the autogenerated path to their images are therefore false. When the screen loads, a blank space appears where the movieclip is supposed to load.

How do I detect that the image link is bad (must be simple as flash gives out debug errors)? I would like to load an alternate image for staff with missing images.

Here’s a snippet of where the movie clips are generated:

 for (i=0;i<nodes.length;i++) {
    attachMovie("container", "new"+i, i, {_x:xPos, _y:yPos});
                
    //load the image from the xml nodes array
    this["new"+i].photo.loadMovie("images/staff/"+nodes*.attributes.photo);
}