Akshay
Akshay

Reputation: 177

Reading The Browser URL in AS3?

My application is integrated with the Other application as a Tab in the IFrame of Parent Application.

I want To read the Browser Address Bar URL.

Is it Possible to read.

<iframe id="myIFrameID123" src="http://192.168.1.102:8080/om/om.html?ucode=" width="100%" height="600"></iframe>

And trying to Access the Parent app URL

var search:String = ExternalInterface.call("window.location.search.toString");
var vars:URLVariables = new URLVariables(search);

If its possible to Read the address Bar URL ll be Fine... Both app running in Different JBOS.

Upvotes: 1

Views: 293

Answers (2)

RIAstar
RIAstar

Reputation: 11912

Since you seem to be using Flex, there is no need for JavaScript injection. You can use an IBrowserManager to access this information:

var url:String = BrowserManager.getInstance().url;

This interface offers quite a few other possibilities to interact with the browser, which you can read about in the docs.

Upvotes: 2

sohel khalifa
sohel khalifa

Reputation: 5578

" If its possible to Read the address Bar URL"

Yes it is possible using:

import flash.external.*;
var curUrl:String =  String( ExternalInterface.call(" function(){ return document.location.href.toString();}"));

Upvotes: 2

Related Questions