PDA

View Full Version : Checking External Server Connection.



as_clark20
October 15th, 2004, 04:55 AM
Hi guys and gals,

I've got a swf called checkconnection.swf and basically this runs off and checks to see if it can get info from our online catalogue servers, however this swf is hosted at our IPS and our servers are here at our building on a different network with a different net address.

When I run the program from the flash program it works fantastic. When I transfer my swf over to our ISP it fails. Can flash check an external source?

So lets say, for example my flash file is hosted at myISP.com and my server is at myServer.com can flash view, post and get things over a different domain? Is there a way to force flash to do this?


Thanks to anyone that can help.

tizzle
October 15th, 2004, 12:09 PM
All you need to do is place a file called crossdomain.xml in the root of the domain that you need to access with the following content:



<?xml version="1.0"?>
<!-- http://www.foo.com/crossdomain.xml -->
<cross-domain-policy>
<allow-access-from domain="*.bar.com" />
</cross-domain-policy>


in the above case foo.com would allow access from all subdomains in bar.com. You can add more rules (and thus domains) to this file as you go along. It's one of the new tricks in flash to make it somewhat more secure.

as_clark20
October 18th, 2004, 04:55 AM
thanks tizzle you're a good un!!

Basically we put the crossdomain.xml file on our pages on Friday and haven't had any we orders since Friday night. Yikes!

Here's the code our actionscript "guru" (see a**holo) assured us would work.



<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>


I don't understand why it has to go to Macromedia. He's been trying to confunse me with all this network/script jargon all week and I'm after solving it before he does. I know its not professional of me but it'd make my week!

where he's put <allow-access-from domain="*"/> he hasn't put any domain or IP address or nothing, I'm sure he thinks that it'll make EVERY domain available to him.

Any ideas?

as_clark20
October 18th, 2004, 08:38 AM
Got it sorted.

Turns out we'd been duped into thinking that this cross-domain-policy.dtd from Macromedia was completely unneccesary and that our programmer doesn't know what he's talking about. Aparently it was for the people running Flash Player 5. Our catalogue doesn't allow anyone with less than flash player 7 anyway. And we changed the <all-access-from domain="*"/> to a fixed domain instead of saying *(any).

Thanks.

tizzle
October 18th, 2004, 12:52 PM
glad it helped. i didn't know about the flash 5 thing with the DTD so thats good new info for me too.