I have an application migrated from flex 3 to Flex 4. I haven't changed anything in the functionality of the code. I call struts actions using a HTTPService:
var service:HTTPService = new HTTPService();
service.url= "someAction.do"
service.send(params);
The problem is that when I'm using the flex 3 swf generated by flash builder 3, there is no problem, the action is sent like I want it to, to the url /someUrl
localhost:8080/someurl/someAction.do
If I use flex 4 swf in the same situation, in the same war archive. The only thing I change is the swf , the url will also contain the path of the swf which causes a problem
localhost:8080/someurl/path/to/swf/someAction.do
Anyone knows what might be causing this?
The documentation for the rootURL property suggests that this is intended behavior for Flex 4:
..., the relative URL is computed automatically based on the location of the SWF running this application. ...
A possible solution would be to use the rootURL
property, though that requires also using the Flex server proxy which might introduce other problems.