Matt,
Thanks for the suggestion. We were actually trying to connect through
an XMLSocket, so there wasn't any way to change the policy file. I
ran some more experiments which indicate that it's not possible to
load a policy file from an http connection and then use and XMLSocket
(unless the connection is the default
http://localhost:80/crossdomain.xml).

It does seem, however, that you can attempt to load a policy file on
a nonstandard port and directory, fail, try a different file in the
same location, succeed, then open an HTTP request to the same port and
directory. We don't have any pressing need to have the Java app
initiate communication with the Flex app (if the need arises, we can
poll), and we don't really care whether we communicate using HTTP or
XML, so this solution will suffice. Thanks again.

Alex


On Mon, 28 Feb 2005 18:16:38 -0800, Matt Chotin <[EMAIL PROTECTED]> wrote:
> 
> 
> 
> Any chance you could create copies of the policy file and just iterate
> through? When you fail to load the first time 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 the Flex app. Connections to
> localhost aren't permitted by default by the flash 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 connection once 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
> 
> 
> 
> 
> Yahoo! Groups Sponsor 
> 
> ADVERTISEMENT
> 
> 
> ________________________________
> Yahoo! Groups Links
> 
> 
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/flexcoders/
> 
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
> 
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


Reply via email to