# Detect broken image links before loading on stage

**URL:** <https://forum.kirupa.com/t/detect-broken-image-links-before-loading-on-stage/206997>\
**Category:** flash\
**Created:** [November 13, 2006, 10:30pm UTC](https://forum.kirupa.com/t/detect-broken-image-links-before-loading-on-stage/206997 "2006-11-13T22:30:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Makea](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@Makea](https://forum.kirupa.com/u/Makea)\
**Post date:** [November 13, 2006, 10:30pm UTC](https://forum.kirupa.com/t/detect-broken-image-links-before-loading-on-stage/206997/1 "2006-11-13T22:30:41Z")

</div>

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:

```auto
 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);
}

```
