7/24/2011 12:28:52 AM
Title:
Error #2044: Unhandled ioError:
import com.adobe.serialization.json.JSON;
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.net.URLVariables;
var message:Array = new Array ();
message.push({"franchiseeSessionKey " : "338165FC-6ED0-7B5D-303F-1F7F55EA49F1"});
trace(message);
var vars: URLVariables = new URLVariables();
vars.data = JSON.encode(message);
trace(vars.data)
var req: URLRequest = new URLRequest();
req.method = URLRequestMethod.POST;
req.data = vars;
req.url = "http://localhost:8080/ail/api/category-flash";
var ldr:URLLoader = new URLLoader();
ldr.addEventListener(Event.COMPLETE, handleServerResponse);
ldr.load(req);
function handleServerResponse(event:Event):void
{
//trace(event.target.data);
}
This things client has provided me
servar url::
http://173.230.129.197:8080/ail/api/category-flash
local url:
http://localhost:8080/ail/api/category-flash
method post()
json:: input
{
"franchiseeSessionKey": "338165FC-6ED0-7B5D-303F-1F7F55EA49F1"
}
7/24/2011 6:40:35 AM
the url you are trying to load is not accessible which throws IO error. You can catch this error by attaching the error handler to your URLLoader.
Use the below code to see whats your error.
//io error handler
ldr.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
// handler function
function ioErrorHandler(e:IOErrorEvent):void {
trace('error: '+e);
}
Rayan
Points: 700
Posts:0
7/24/2011 7:21:28 AM
your URL may not be accessible due to different domain. Try using the crossdomain.xml in the root of website whose URL you are trying to access.