Question : NavigatetoURL problem with Javascript call

I have a flash file and using NavigatetoURL to get a link from an XML file and load it into a div container. The Javascript function I am using came from DynamicDrive and is called ajaxPage. The XML reads fine and I get the information I need; the problem I have is an an error message relating to line 30 in my Javascript function: "Access Denied"

line 30 = page_request.open('GET', url+bustcacheparameter, true)

Adobe website sdays the following but I do not think it pertains to my setup as I am running this on my local pc under IIS;

"For local content running in a browser, calls to the navigateToURL() method that specify a "javascript:" pseudo-protocol (via a URLRequest object passed as the first parameter) are only permitted if the SWF file and the containing web page (if there is one) are in the local-trusted security sandbox. Some browsers do not support using the javascript protocol with the navigateToURL() method. Instead, consider using the call() method of the ExternalInterface API to invoke JavaScript methods within the enclosing HTML page.

In Flash Player, and in non-application sandboxes in Adobe AIR, you cannot connect to commonly reserved ports. For a complete list of blocked ports, see "Restricting Networking APIs" in the security chapter of the Programming ActionScript 3.0 book.
"

I wonder if anyne can help as I have found no answers on the internet at all... :(
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
AS3
------
function onMouseClickEvent(event:Event)  {  
trace("IN: "+glo.myURLvar.myURL);
var websiteURL:String = "Javascript:ajaxpage('" + glo.myURLvar.myURL + "','ajaxcontent');"
trace(websiteURL);
var request:URLRequest = new URLRequest(websiteURL);
navigateToURL(request, '');
}
 
-----------
JS Code
-----------
function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}
Open in New Window Select All

Answer : NavigatetoURL problem with Javascript call

I sort of figured out the issue;for some reason cross-domain URLs in the way I have used them in the Javascript call is invalid. So I have had to use realtive pages in my XML file and then quickly redirect those pages to the external websites. to scoot round the problem.
Random Solutions  
 
programming4us programming4us