I write a small flex project that connect to local database
the code is below:
_dbData=new DataBaseData();
_dbData.username="root";
_dbData.password="woxnsk";
_dbData.host="192.168.2.225";
_dbData.port=3306;
_dbData.database="query";
_db=new MyDataBase(_dbData);
_db.addEventListener(Event.CONNECT, onConnected);
_db.connect();
_isDBConnecting=true;
the project works well in flex builder,then I deployed it in my wamp server and something went wrong.
I can access the databse when I use the url like localhost/myproject/login.html but if I change the localhost into 127.0.0.1 or the ip 192.168.2.225, it failed to connect to database , and the error is Security Sandbox violation.
Error #2044: unhandled ioError: text=Error #2048: Security Sandbox violation.:http://192.168.2.225/bin-debug/QuestionCollecter.swf cannot load data from 192.168.2.225:3306
I have put the crossdomain.xml in the root directory of my server (C:\wamp\www or C:\apache-tomcat-6.0.35\webapps\ROOT) the crossdomain.xml file is :
<xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*" to-ports="*" />
</cross-domain-policy>
it does not work....so is there anything wrong? Can anyone help me~