# Problem checking if a image exist before loading another image

**URL:** https://forum.kirupa.com/t/problem-checking-if-a-image-exist-before-loading-another-image/331074
**Category:** flash
**Created:** [May 9, 2013, 4:33pm UTC](https://forum.kirupa.com/t/problem-checking-if-a-image-exist-before-loading-another-image/331074 "2013-05-09T16:33:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![warex](https://avatars.discourse-cdn.com/v4/letter/w/77aa72/32.png) [@warex](https://forum.kirupa.com/u/warex)
#### Post date: [May 9, 2013, 4:33pm UTC](https://forum.kirupa.com/t/problem-checking-if-a-image-exist-before-loading-another-image/331074/1 "2013-05-09T16:33:41Z")

</div>

Hi guys , I’m new in flash and i’m having a problem using conditional statments in AS2. I’m trying to load a new image depending on the image that is allready inside the movieclip. What seems to happen is that flash isn’t verifying the statments that I have in my code and so thr images don’t load correctly acorrding to the conditions. I have a movieclip within a movieclip, the first one has an instance name “photo” and the second one is “empty”.

I’m using this code in one button:

on (release) {

```
if (empty == "Assets/Scroll.png", _root.photo.empty){

loadMovie("Assets/Photo1.jpg", _root.photo.empty);

} else if (empty == "Assets/images.jpg", _root.photo.empty){

loadMovie("Assets/design.jpg", _root.photo.empty);

```

gotoAndPlay(6);

```
}

```

}

Would someone please help me, I’m loosing my mind :krazy:

Thanks!!
