Flex: Security Error Accessing URL

While playing around with Flex and Web Services, I encounter the following error while trying to access my web service: Security Error Accessing URL.

One solution around this error is to add a crossdomain.xml file in your root directory:

<?xml version="1.0"?>
<cross-domain-policy>
    <allow-access-from domain="*"/>
</cross-domain-policy>

But in my case I simply changed my web service definition in Flex from:

<mx:WebService id="employeeService"
 wsdl="http://localhost:8080/EmployeeService/services/EmployeeService?wsdl"
 useProxy="false" showBusyCursor="true" fault="mx.controls.Alert.show(event.fault.faultString)">

To:

<mx:WebService id="employeeService"
 wsdl="http://127.0.0.1:8080/EmployeeService/services/EmployeeService?wsdl"
 useProxy="false" showBusyCursor="true" fault="mx.controls.Alert.show(event.fault.faultString)">

That got it working.