Solved

IOErrorEvent not working

Posted on 2008-10-14
5
312 Views
Last Modified: 2013-11-11
For some reason my IO Error handler isn't working, and I'm getting

Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

The files I'm looking for aren't supposed to be there, but I should at least get THUMB ERROR to show up in my debugger!
public function loadThumb(evt:ListEvent) {
			if ( evt.item.thumb != null && evt.item.thumb != "" ) {
				this.thumbNail = this["thumb" + this.bladeNumber];
 
				var ldr:Loader = new Loader();
				
				ldr.addEventListener( IOErrorEvent.IO_ERROR, ldrIoErrorHandler );
				ldr.contentLoaderInfo.addEventListener( Event.COMPLETE, thumbLoaded );
 
				evt.item.thumb = "\\"+ evt.item.thumb;
 
				var myRequest = new URLRequest( evt.item.thumb );
 
				ldr.load( myRequest );
				this.thumbNail.image.addChild( ldr );
			}
		}
		
		
		public function ldrIoErrorHandler(event:IOErrorEvent):void {
			
			trace("THUMB ERROR");
			
			
		}

Open in new window

0
Comment
Question by:walker6o9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 39

Expert Comment

by:blue-genie
ID: 22719125
does that if condition get met for the listener to trigger?
0
 
LVL 1

Author Comment

by:walker6o9
ID: 22723756
yes
0
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 total points
ID: 22724726
try this instead.
ldr.contentLoaderInfo.addEventListener( IOErrorEvent.IO_ERROR, ldrIoErrorHandler );
0
 
LVL 1

Author Closing Comment

by:walker6o9
ID: 31506180
NAILED IT
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 22728716
f*$!_ AS3.
the loader object itself doesn't register for events - it's content does. - go figure. one for the Adobe geeks to explalin.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question