View Full Version : Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. Cannot be caught
Rocketboy
05-08-2008, 03:59 PM
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: file:///C|/LocalWorkspace/Simulation%20Platform/sim/assets/conversations/14/Maria/NPC_104.MRK
Hi all, I'm getting this error, and I damn well know why. Its because I'm trying to load a file that doesn't exist. But the thing is, I'm wrapping the code in a try catch, and I'm still getting the error. Also, I'm being told that the error is on this line:
var loader:URLLoader = new URLLoader();
I need to do it this way because i know that some of the files I'm trying to load do not yet exist.
But what could possibly be wrong with this line? And either way, it should be caught by the try, catch. So, whats the problem?
try {
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, completeHandler);
loader.load(new URLRequest(_filename));
} catch (error:Error) {
trace("DATA: loadAnimData(): Error loading lip synch data.");
}
xwielder
05-08-2008, 04:03 PM
You can't use a TRY/CATCH with that type. Use this instead:
loader.contentLoaderInfo.addEventListener(IOErrorE vent.IO_ERROR, loaderMissing);
function loaderMissing(event:IOErrorEvent):void
{
trace("ERROR");
}
Rocketboy
05-08-2008, 04:10 PM
xwielder,
ReferenceError: Error #1069: Property contentLoaderInfo not found on flash.net.URLLoader and there is no default value.
contentLoaderInfo is a property of the Loader object, however, I am using the URLLoader object
Also, I am using the exact same code that is given the the Flash help section on the URLLoader object. From flash:
public function URLRequestExample() {
var loader:URLLoader = new URLLoader();
configureListeners(loader);
var request:URLRequest = new URLRequest("XMLFile.xml");
try {
loader.load(request);
} catch (error:Error) {
trace("Unable to load requested document.");
}
}
xwielder
05-12-2008, 12:20 PM
Did you get this to work yet? I'm still not convinced that try/catch can be used in this instance, but I've been proven wrong many, many times before. :D
amarghosh
05-12-2008, 12:32 PM
ReferenceError: Error #1069: Property contentLoaderInfo not found on flash.net.URLLoader and there is no default value.
contentLoaderInfo is a property of the Loader object, however, I am using the URLLoader object;
loader.addEventListener(IOErrorEvent.IO_ERROR, loaderMissing);
function loaderMissing(event:IOErrorEvent):void
{
trace("ERROR");
}
xwielder
05-12-2008, 01:13 PM
Yep, thanks amar.
I also found this scripture from the Actionscript 3.0 Cookbook, on pages 649-650:
package
{
import flash.events.*;
import flash.net.*;
import flash.util.trace;
public class Example
{
public function Example ( )
{
// Create the URLLoader instance to be able to load data
var loader:URLLoader = new URLLoader( );
// Define the event handlers to listen for success and failure
loader.addEventListener ( IOErrorEvent.IO_ERROR, handleIOError );
loader.addEventListener ( HTTPStatusEvent.HTTP_STATUS, handleHttpStatus );
loader.addEventListener ( SecurityErrorEvent.SECURITY_ERROR, handleSecurityError );
loader.addEventListener ( Event.COMPLETE, handleComplete );
// Configure the loader to load URL-encoded variables
loader.dataFormat = DataFormat.VARIABLES;
// Attempt to load some data
loader.load ( new URLRequest( "example.txt" ) );
}
function handleIOError ( event:IOErrorEvent ):void
{
trace ( "Load failed: IO error: " + event.text );
}
function handleHttpStatus ( event:HTTPStatusEvent ):void
{
trace ( "Load failed: HTTP Status = " + event.status );
}
function handleSecurityError ( event:SecurityErrorEvent ):void
{
trace ( "Load failed: Security Error: " + event.text );
}
function handleComplete ( event:Event ):Void
{
trace ( "The data has successfully loaded" );
}
}
}
Rocketboy
06-26-2008, 04:04 PM
Yep, that worked. Thanks guys.
AScripter
07-02-2008, 08:51 PM
HEY!
I to have a problem
IN ADOBE FLASH 9.0.2 I HAVE A FEW WRRORS IN MY ACTION SCRIPT.
THIS SCRIPT IF FOR A MOUSE REPRODUCTION.
Mouse.hide();
cursorNew.onMouseMove = function () {
cursorNew._visible = ture;
this._x = _root._xmouse;
this._y = _root._ymouse;
updateAfterEvent();
}
HERE ARE THE ERRORS
Line 3, Line 4, Line 5, Line 6
amarghosh
07-03-2008, 04:01 AM
Mouse.hide();
cursorNew.addEventListener(MouseEvent.MOUSE_MOVE, moveHandler);
function moveHandler(e:MouseEvent):void
{
cursorNew.visible = true;
this.x = e.stageX;
this.y = e.stageY;
e.updateAfterEvent();
}
st3ph3n
11-25-2010, 04:24 AM
Hey .. I'm new to this and I'm confused , I'm following a tutorial about building a gallery & trying to bring in a XML image file, the xml file is in the same folder as the flv file how however the I get the error code Error #2044 so I can't proceed to the next step. I checked it and checked it but can't figure please Help
code is
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("data/image.xml"));
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
function xmlLoaded(event:Event):void
{
trace(event.target.data);
}
output
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: file:///C|/Documents%20and%20Settings/S/Desktop/images/data/image.xml
at testgallery_fla::MainTimeline/frame1()
Thank you so much for any help in advance .. apologies for taking your time just learning .
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.