views:

660

answers:

4

I need to access an ASP.Net2 page from Action Script 3.0 and I wrote the code in .fla file that access the asp.net page but there is a problem in the accessing it reports to me the following error :

Error opening URL 'http://localhost/Trial/Default.aspx' Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://localhost/Trial/Default.aspx at Script1/sendSQLXML() at Script1$iinit()

and after searching I found that it is a problem related to Cross Domain policy so I created an XML file called Crossdomain.xml with the following code:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"&gt;


<cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*" secure="false"/>
    <allow-http-request-headers-from domain="*" headers="*" secure="false"/>
</cross-domain-policy>

and i don't know how to use it from ACS3 and where to put it Note: i run the Asp.Net2 page in the IIS

A: 

Look into the loadPolicyFile(..) method: http://livedocs.adobe.com/flex/3/langref/flash/system/Security.html#loadPolicyFile()

Peter Richards
i used the following code : Security.loadPolicyFile("http://localhost/Trial/crossdomain.xml");and it reports to me the following error:Security.loadPolicyFile("http://localhost/Trial/crossdomain.xml"); and points to the new line of the code that inserted.
Ahmy
Did you add the import line for the Security class? import flash.system.Security;
Peter Richards
Also just noticed that you have an extra ; at the end. You have .xml";); and it should just be .xml");
Peter Richards
i have imported the required package (flash.system.Securit;) but the problem still exist and report the following error:Error opening URL 'http://localhost/Trial/Default.aspx'Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://localhost/Trial/Default.aspx
Ahmy
A: 

IF you're working localy (http://localhost/Tri...), i'm not sure that the problem come from some CrossDomain issues...

OXMO456
so from where the problem come ? are there any checks i have to do?
Ahmy
in order to help you more, you should post the AS3 code... and tell us what the ASP.net return (text, binary file, stream...?).cordially,
OXMO456
i wrote the code of ASC3 and Asp.net code in previous question but no answer at all check it in the foloowing URL:http://stackoverflow.com/questions/670702/recieving-data-from-actionscript3-in-asp-net2and the asp.net code is just :response.write("test successed");
Ahmy
ok... your AS3 code seems correct, unfortunatly i don't know ASP.NET... sorry
OXMO456
have a look > http://www.judahfrangipane.com/blog/?p=87
OXMO456
A: 

Typically the crossdomain file gets placed at the root of the server, if you are running locally you shouldn't be having crossdomain issues, but you might want to try placing it in c:\inetput\wwwroot\ and see if that addresses your issue.

Raul Agrait
A: 

crossdomain.xml gets put at the root of the server you are trying to access. that's the default location such that you won't need to call Security.loadPolicyFile()

Scott Evernden