# Security sandbox - Flash/Java integration

**URL:** <https://forum.kirupa.com/t/security-sandbox-flash-java-integration/311322>\
**Category:** flash\
**Created:** [July 2, 2010, 5:44pm UTC](https://forum.kirupa.com/t/security-sandbox-flash-java-integration/311322 "2010-07-02T17:44:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsprathapsimha](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@bsprathapsimha](https://forum.kirupa.com/u/bsprathapsimha)\
**Post date:** [July 2, 2010, 5:44pm UTC](https://forum.kirupa.com/t/security-sandbox-flash-java-integration/311322/1 "2010-07-02T17:44:30Z")

</div>

Hi,

I am building a flash AS3 application that interacts with server (Java) for user authentication. My flash files are placed in local system and this needs to interact with server.

In publish settings I have chosen “Access Network Only” for Local play back security.

This works fine when I publish/view files in Flash CS5 authoring tool. I am able to communicate with server when I view it in flash authoring tool.

**If I embed the SWF file in HTML and try to open it, it displays following error message:  
Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: file://C:\Documents and Settings\Desktop\Test.swf cannot load data from [http://ipaddress](http://ipaddress):port/user/authenticate?username=user&password=password. at Test\_fla::MainTimeline/frame1()**

I thought this may be related to cross domain policy file. So I placed the cross domain policy file at [http://someip](http://someip):port/user/authenticate with allow-domain="\*". But it displays same error message.

Below is AS3 code that I am using:-

var variables:URLVariables=new URLVariables();  
variables.username=“user”;  
variables.password=“password”;

var request:URLRequest=new URLRequest(“[http://ipaddress](http://ipaddress):port/user/authenticate”);  
request.method=URLRequestMethod.GET;  
request.data=variables;

var loader:URLLoader=new URLLoader();  
loader.load(request);

loader.addEventListener(Event.COMPLETE, completeHandler);

function completeHandler(event:Event)  
{  
trace(event.target.data);  
}
