event listener for error with loader?

I need to add  a listener for a loader in AS3 that runs a function when the jpg loading doesn't exist.

couldn't find a event.ERROR or the like.

just have what happens when the jpg is found:
imageloader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded_image);

// in as2
LoadListener.onLoadError = function(targetMC:MovieClip) {
	msgbox ( "Empty!")
	imageLoader.loadClip(base_url+"data/empty.jpg", targetMC);

Open in new window

Who is Participating?
RoryRConnect With a Mentor Author Commented:
never mind, solved myself.
imageloader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, image_failed);
function image_failed(e:IOErrorEvent) {
	imageloader.load(new URLRequest("canvas/empty.jpg"))

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.