I am very new to flex, i have created a simple login page in flex and created a webproject in Eclipse having a jsp page. i have put that jsp page in tomcat webapps. Now when i run an application of login from FlashBuilder it runs fine as i have given the ip e.g http://111.111.111.111/login.jsp and passing it as a url in HttpService and it worked fine. but when i put my login.swf file in webapps same in that folder where that jsp resides and un e.g http://localhost:8080/login.swf it displays the page but when i click on the login button it gives开发者_如何学JAVA me with this error "Security error accessing url" i have checked it in this way few days back it worked fine but now i am stuck into this err plz help me out.
Try using a crossdomain.xml file just in case:
<?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>
If that doesn't work, I think it's because adobe flash/flex files that access certain web related items don't work correctly when using localhost. You'll have to add it to your trusted domains at:
Updated link: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.html#119065
You can use the crossdomain.xml, or set up a proxy within your web app, so that basically you'd call to myserver/myapp/someotherservice?whatever, and the backend would make the calls out to the service you want, but make it look to Flash as if its still in the same domain, because it technically is.
精彩评论