PDA

View Full Version : ioError handeling. Cannot trace out :( PLEASE help!



phalangie9
July 20th, 2009, 11:06 AM
I am in big trouble. I have a project that was already supposed to be launched. It tested fine on my computer, but is throwing an error on other browsers....and I cannot figure out how to catch the error! I have been reading and trying everything, but nothing is working!!!

I captioned a video using components, but the captions are stored in the video and the source then is "0". Flash doesn't understand "0", but the captions still work. I need Flash to ignore the error so it stops crashing the browsers!! Any help would be so greatly appreciated!!

This is my error:

Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: file:///Macintosh%20HD/Users/angie/Desktop/standards/Web%20Files/Clarence%20Open/0


This is the code throwing the error:

import fl.video.FLVPlayback;
import fl.video.FLVPlaybackCaptioning;

var vid:FLVPlayback = new FLVPlayback();
var vidCapOpen:FLVPlaybackCaptioning = new FLVPlaybackCaptioning();

vid.source = "scienceOpen.flv";
addChild(vid);
addChild(vidCapOpen);

vidCapOpen.autoLayout = false;
vidCapOpen.source = "0";
vidCapOpen.showCaptions = true;

This is what I already tried (found on another thread):
var loader:URLLoader = new URLLoader();

loader.addEventListener(IOErrorEvent.IO_ERROR, catchIOError);
function catchIOError(event:IOErrorEvent){
trace("Error caught: "+event.type);
}

loader.load(new URLRequest("Invalid XML URL"));
trace("Continuing with script...");

senocular
July 20th, 2009, 11:15 AM
use try{ }catch(error:Error){} around your load()

phalangie9
July 20th, 2009, 11:27 AM
use try{ }catch(error:Error){} around your load()


I'm not sure where to put the code you suggested :(
I think there's some variable from my code I should be using, but don't know what it is. I am copying and pasting directly from many threads and blogs...but none of it is catching my error....


I put it in like this:

var loader:URLLoader = new URLLoader();

loader.addEventListener(IOErrorEvent.IO_ERROR, catchIOError);
function catchIOError(event:IOErrorEvent){
trace("Error caught: "+event.type);
}


loader.load(new URLRequest("Invalid XML URL"));
trace("Continuing with script...");


try{
loader.load(new URLRequest("Stream Error"));

}

catch(error:Error){
trace("Please Work");
}


But it didn't see the try/catch. This is what showed up in the output:

Continuing with script...
Error caught: ioError
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: file:///Macintosh%20HD/Users/angie/Desktop/standards/Web%20Files/Clarence%20Open/0

senocular
July 20th, 2009, 11:47 AM
make sure you add listeners for all error types for all objects that can produce errors and wrap all apis that throw errors with try catch statements.

The code you posted should not produce that third statement (unhandled ioError). Are you sure you don't have another loader somewhere?

dail
July 20th, 2009, 12:11 PM
Usually, you wrap a load operation like the following.


var loader:URLLoader = new URLLoader();
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);


var request:URLRequest = new URLRequest("urlLoaderExample.txt");
try {
loader.load(request);
} catch (error:Error) {
trace("Unable to load requested document.");
}

function ioErrorHandler(event:IOErrorEvent):void {
trace("ioErrorHandler: " + event);
}


Why do you need to load captions if you have embedded them within your flv? My understanding is that the flvCaptioning component expects a URL to an XML file containing your captions. Are you providing it with that URL?

phalangie9
July 20th, 2009, 12:28 PM
I'm not passing an XML file for the captioning component -- which is why I'm getting the error. Our video guys "baked" the captions into the .flv -- but the only way to access those is through the captioning component (that I know of).

The guy who told me to do it this way said "You will get Network IOerrors because the FLVPlaybackCaptioning component can’t find ‘0' [speaking of the source givent for xml file]. This is normal. You may want to add an eventListener for IOErrorEvent, and just trace a message to prevent the error from popping up in debug player."

But he is not here to help me this week. None of what I've tried so far has worked :(

dail
July 20th, 2009, 03:32 PM
Are the captions part of the flvs metadata? If so, you can use actionscript to display them.

phalangie9
July 21st, 2009, 09:39 AM
Are the captions part of the flvs metadata? If so, you can use actionscript to display them.

I hate to keep sounding like a newb (well...I guess I am!) but do you know how to do that? I'm trying to find online...but everything is pointing to the timed text XML for help....

dail
July 21st, 2009, 02:58 PM
Do the captions show up if you play your flv in say, quicktime, or adobe media player? Or do they not?

Do you even have an external XML file for your captions?

This link might help with listening for cue points etc; http://help.adobe.com/en_US/ActionScript/3.0_UsingComponentsAS3/WS5b3ccc516d4fbf351e63e3d118a9c65586-7feb.html#WS5b3ccc516d4fbf351e63e3d118a9c65b32-7f05