# \<policy-file-request/\> error

**URL:** <https://forum.kirupa.com/t/policy-file-request-error/256651>\
**Category:** flash\
**Created:** [April 5, 2008, 4:25am UTC](https://forum.kirupa.com/t/policy-file-request-error/256651 "2008-04-05T04:25:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shawnske](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@shawnske](https://forum.kirupa.com/u/shawnske)\
**Post date:** [April 5, 2008, 4:25am UTC](https://forum.kirupa.com/t/policy-file-request-error/256651/1 "2008-04-05T04:25:16Z")

</div>

Hi, I am trying to make a flash client connect to a Java server with a socket. Now once I load this onto a webpage, It returns \<policy-file-request/\> in the Java and these error shows up on the client  
“[SecurityErrorEvent type=“securityError” bubbles=false cancelable=false eventPhase=2 text=“Error #2048”]”. Now this is the client:

```auto
var s :Socket = new Socket("72.39.245.71", 1234);
Security.loadPolicyFile("http://www.free-javatutorials.com/crossdomain.xml");
s.addEventListener(ProgressEvent.SOCKET_DATA, sData);
s.addEventListener(Event.CONNECT, onConnect);
s.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

function sData(e:ProgressEvent):void {
    var d:String = s.readUTFBytes(s.bytesAvailable);
    Text.text += d;
}

function onConnect(s:Boolean):void {
    if(s) {
        Text.text += "Connection successful..."
    } else {
        Text.text += "Connection failed..."
    }
}

function onSecurityError(e:Event):void {
    Text.text += e;
}

```

This is the xml file:

```auto
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <site-control permitted-cross-domain-policies="master-only"/>
  <allow-access-from domain="*"/>
</cross-domain-policy> 

```

I have no idea what is wrong and how I can fix. All I know is that it is a sandbox issue.

If anyone knows how to fix this or would like to help me then I would be more than thankful.
