Your Universal Remote Control Center
RemoteCentral.com
RTI Control Systems Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 18 made on Wednesday October 3, 2007 at 09:20
CLIQK LABS
Long Time Member
Joined:
Posts:
September 2007
17
There is something else you should be aware of before starting a flash app. As a security measure, a flash movie is only allowed to communicate with the server that the SWF was downloaded from. So if you hosted the flash movie on the http server of your NAS, that movie will only be able to send http traffic to the NAS.

If you wanted to make a Flash weather app that talks to weather.com to get the current forecast, you would need to be able to also host your swf on weather.com (not likely).

There are a few ways to get around this...

1. Crossdomain XML
If you have access to the web root of both the server hosting the SWF and the server that you want to communicate with, you can put a crossdomain.xml file in the web root of both devices and Flash will see this and allow communication between the two.

More info is available from Adobe:
[Link: kb.adobe.com]

There is a good thread explaining crossdomain here:
[Link: forum.chumby.com]


2. Setup a Proxy
This is what I will be doing. I have setup an Apache server with PHP and Curl. I will host my SWF on this server, and setup a PHP proxy script. Whenever I need my flash to communicate to a device, I will point it to the URL of my apache server (same domain that the SWF was pulled from) and then have PHP forward the requests to the correct IP address. This will allow me to connect to any number of devices or web services without having to do any tricks with crossdomain.

-

Also, none of this crossdomain matters when you are running an SWF from within Flash Debugger, or if you run it as a Projector (.EXE or .HQX). When a flash movie is run locally it is allowed to communicate with any ip address. If your Flash works on your computer but not on your touchpanel, this could be why.

-CLIQK LABS
http://cliqklabs.com


Hosting Services by ipHouse