Hi,
I am trying to debug ActionScript within CS4. The script, as you can see below, is making a GET request to a URL that I am hosting from my machine. When I try to debug the movie I get an message box that says:
Adobe Flash Player has Stopped a potentially unsafe operation. The local application that you are running on your computer: "C:\myapplication.swf" is trying to make a communicate with this Internet-enabled location:
localhost
To Let this application communicate with the internet click Settings.
So I click settings, and on the Global Security Panel that opens up in my browser, I select Always Allow, close my flash movie and try again. Same error.
Has anyone had this problem?
var requestVars:URLVariables = new URLVariables();
requestVars.ornTest = "test";
var request:URLRequest = new URLRequest();
request.url = "http://localhost/apps/game/tree/DesignFlash.aspx";
request.method = URLRequestMethod.GET;
request.data = requestVars;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.addEventListener(Event.COMPLETE, loaderCompleteHandler);
loader.addEventListener(HTTPStatusEvent.HTTP_STATU S, httpStatusHandler);
loader.addEventListener(SecurityErrorEvent.SECURIT Y_ERROR, securityErrorHandler);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
try
{
loader.load(request);
}
catch (error:Error)
{
trace("Unable to load URL");
}
private function loaderCompleteHandler(event:Event):void
{
var variables:URLVariables = new URLVariables( event.target.data );
if(variables.success)
{
var ornArray = deserializeString(variables.ornData);
for(var i:int=0;i<ornArray.length;i+=3)
{
addOrnamentProperty(ornArray[i],ornArray[i+1],ornArray[i+2]);
}
addOrnamentsFromArrayList();
}
}