# Loaded external image question: Use default image if loaded image not found?

**URL:** https://forum.kirupa.com/t/loaded-external-image-question-use-default-image-if-loaded-image-not-found/269403
**Category:** flash
**Created:** [August 27, 2008, 4:49am UTC](https://forum.kirupa.com/t/loaded-external-image-question-use-default-image-if-loaded-image-not-found/269403 "2008-08-27T04:49:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![alex298](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@alex298](https://forum.kirupa.com/u/alex298)
#### Post date: [August 27, 2008, 4:49am UTC](https://forum.kirupa.com/t/loaded-external-image-question-use-default-image-if-loaded-image-not-found/269403/1 "2008-08-27T04:49:16Z")

</div>

Hello,

I use the following code to load an external logo into a Flash Movie.

> 

var myRequest:URLRequest=new URLRequest(logoPath);  
var loader:Loader = new Loader();  
loader.load(myRequest);  
holder\_mc.addChild(loader);

What if the logo file is not find? I wish that if the logo is not found, another default logo will be used, i.e.

if (logoPath is here) {  
var myRequest:URLRequest=new URLRequest(logoPath);  
} else (logoPath is not here) {  
var myRequest:URLRequest=new URLRequest(“defaultlogo.png”);  
}

How can I do that?

Thanks and best regards

Alex
