Security sandbox - Flash/Java integration

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: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: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: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);
}