02-03-2011 10:13 PM
Hi Gurus,
I have a problem with the <mx:HTTPService> tag the following is the actual tag,
<mx:HTTPService
id="Srv"
url="data.xml"
useProxy="false"
method="POST" result="resultHandler(event)"/>
When accessed locally I can see the data in the flex as the data.xml can be reached. when the same is accessed from internet behind firewall, the url is entirely different and the .swf file in the BSP page cannot access the data.xml. I cannot give the absolute url in the tag as the BSP page application is accessed differently in different servers. any help on this would be greatly appreciated
Thanks
Akbar
02-11-2011 2:52 PM
02-11-2011 2:52 PM
02-11-2011 3:03 PM
Sorry somehow I missed this question, an even easier way to do this is to allow your Flash movie to "script" ( this is the default behavior for a Flex application ) and then call some javascript to obtain exactly what the page URL is and then go from there to get your data:
import flash.external.ExternalInterface;
import mx.utils.URLUtil;
var
if(ExternalInterface.available){
pageURL = ExternalInterface.call("window.location.href.toString");
// Do whatever you need with the URL here.
var serverName:String = URLUtil.getServerNameWithPort(pageURL);
}
-d
02-11-2011 5:15 PM
Hi Daniel,
Thanks for your response, I tried to implement you code, I get a syntax error on this line
pageURL = ExternalInterface.call("window.location.href.toString");
1120: Access to undefined porperty pageURL
02-11-2011 5:17 PM
For some reason when posting it here i "lost" that variable declaration. You can see the beginning of it with the "var" line:
import flash.external.ExternalInterface;
import mx.utils.URLUtil;
var pageURL:String;
if(ExternalInterface.available){
pageURL = ExternalInterface.call("window.location.href.toString");
// Do whatever you need with the URL here.
var serverName:String = URLUtil.getServerNameWithPort(pageURL);
}
02-11-2011 9:53 PM
Hi Daniel,
The URL which is returned by the window.location.href is not the actual url , the bsp page is inside an
iview and the url of the top frame is different from the frame in which iview is (window.location.href), so the data.xml is not
reached
Thanks
A