Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Adobe flex data.xml file not reachable from bsp behind firewall

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Found the solution to the problem, passing url thorugh flashvars

5 REPLIES 5

Former Member
0 Kudos

Found the solution to the problem, passing url thorugh flashvars

0 Kudos

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

0 Kudos

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

0 Kudos

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);
}

0 Kudos

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