# onData jpg

**URL:** <https://forum.kirupa.com/t/ondata-jpg/151924>\
**Category:** flash\
**Created:** [June 19, 2005, 4:38pm UTC](https://forum.kirupa.com/t/ondata-jpg/151924 "2005-06-19T16:38:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerryj](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jerryj](https://forum.kirupa.com/u/jerryj)\
**Post date:** [June 19, 2005, 4:38pm UTC](https://forum.kirupa.com/t/ondata-jpg/151924/1 "2005-06-19T16:38:18Z")

</div>

Hi,  
I am loading jpg’s, and I want to make a Movieclip(‘MC’) invisible when there is no jpg to load (because it just is not there). How can I detect if there is no jpg, and then make the MC invisible? I think I should use onData, but I can’t make it work.  
[AS]  
function laadNail3(foto) {  
var my\_lv:LoadVars = new LoadVars();  
my\_lv.onData = function(src:String) {  
if (src == undefined) {  
MC.\_visible = false;  
}  
foto = src;  
};  
my\_lv.load(foto, holder);  
}[/AS]  
I am also confused where to put the Movieclip that holds the jpg (‘holder’)?

The data passed to the function comes from another swf, saying:  
laadNail3(“b3.jpg”);[/AS][AS]

Could someone show me how to do this?

thank you,

Jerryj.
