The security of the Flash Player is very strict, so if you have your SWF being loaded from the local file system, you will get an error when accessing any URL, even on the localhost.
There are two ways to deal with this :
- load your SWF from the Web server as well. If you are running on a local web server, instead of double clicking on your html file on your hard drive, make that HTML file available from the server and use your web browser to access it.
- access to the the Flash Security Manager and add your SWF or SWF Directory to the authorized list. This will enable your SWF to access the internet even when loaded locally.