views:

73

answers:

1

I'm very new to Flex and I have what I think it a head-scratcher.

I am building a little Flash app that will consume some web services over HTTP. When I am in Flexbuilder and run my app there, it works fine. When I goto to my FlexBuilder project on my OS and double-click on it, it works fine. When I zip up my bin-debug file, I get this error:

Security error accessing url faultCode:Channel.Security.Error faultString:
'Security error accessing url' faultDetail:'Destination: DefaultHTTP'

So I googled that and got information on about the crossdomain.xml file. Well, I can't put a crossdomain file in the service I am calling, but I can put one somewhere else. So I put the following lines in Flex app:

Security.allowDomain("vx1391");

Security.loadPolicyFile("http://vx1391:8080/job/Remote%20FIT%20Runner/ws/trunk/flash-cross-domain.xml");

My cross-domain.xml file is wide-open:

<cross-domain-policy>
  <allow-access-from domain="*"/>

</cross-domain-policy>

Which I know is bad in a prod enivironment, but right now I just need to get this working locally but outside of FlexBuilder.

Anyone want to help out this Flex-noob?

+1  A: 

The best way to deal with this is to use a proxy instead of a crossdomain.xml file. You can use Apache or BlazeDS as a proxy. As long as all of the requests from the SWF are made to the same site that the SWF came from, then you shouldn't get any security errors. If you only need to get around this for your own testing then another alternative is to add the SWF to the Flash Player trust file (which is what FB does).

James Ward
I added the SWF to the Trust file and that worked like a champ. I'll mess with the proxy stuff later.
MikeHoss