Any chance you could create copies of the
policy file and just iterate through? When you fail to load the firsttime
wait a few seconds and try loading the next policy file. Not sure why
loadPolicyFile won’t try the same file again, but this might be a cheap
workaround.
Matt
From: Alex Cruikshank
[mailto:[EMAIL PROTECTED]
Sent: Monday, February 28, 2005
3:56 PM
To: [EMAIL PROTECTED]
Subject: [flexcoders] Is
System.security.loadPolicyFile() one shot only?
We are trying to get our flex application to communicate with a Java
Web Start application by starting a socket
listener in the Java app
and connecting to it with a XMLSocket in theFlex
app. Connections to
localhost aren't permitted by default by theflash
player, so we're
using System.security.loadPolicyFile() to load a
cross-domain policy
served by the Java app before connecting.
This works great in our tests, so long as the Java
app is started and
listening before the Flex app tries to load the
policy file. If the
app is unavailable the connection fails (as
expected), but there
appears to be no way to reset the connectiononce
the Java app is up
and running without reloading the Flex
app. Subsequent calls to
System.security.loadPolicyFile() don't correct the
problem. Since the
Flex app is responsible for starting the Java app
and has no way of
knowing when it's initialized, this situation is
unacceptable.
Does anyone on the list know if this is a feature
of the Flash
player's sandbox, or is there a way to try the
policy file again? If
not, has anyone worked out a method of
communicating with a non-Flash
application (other than an applet) on the client
machine? I greatly
appreciate any insight or references you can
provide.
Thanks,
Alex Cruikshank
Carbon Five
|