Skip to main content
Known Participant
September 20, 2014
Answered

Visit A Website Behind The Scenes In Adobe Air Application...

  • September 20, 2014
  • 2 replies
  • 456 views

Hi all,

I am needing to find a way in Actionscript 3 for a Adobe Air application to visit a website url (ex. example.com) in the background without Adobe Air opening up a web browser.

After the website has loaded in the background, I would like to get all the URL link that the Adobe Air application may see. For example, maybe when you visit "example.com" it redirects you to "google.com", so I want my application to send me back whatever URL it sees after it loads the page.

Can this be done, and is there any sample code anywhere?

Thanks guys!

This topic has been closed for replies.
Correct answer Aaron Beall

I think you can get the information you want by using URLLoader with a listener for HTTP_RESPONSE_STATUS and check the responseHeaders and responseURL properties:

HTTPStatusEvent - Adobe ActionScript® 3 (AS3 ) API Reference

-Aaron

http://abeall.com

2 replies

Participant
September 23, 2014

you can probably use a hidden StageWebView for that. Even javascript redirects would be followed. I think you have to give the StageWebView a stage but the viewPort can stay at 0x0 width/height. The url can be recovered with webView.location

rs14smithAuthor
Known Participant
September 21, 2014

Update. I see you can use URLRequest to visit the URL, but I am still having a problem retrieving the new URL after the HTTP request has loaded/completed. Basically, the page that I visit will redirect you to another page, and I need to find out through Actionscript what page it was redirected to by looking at the URL.

Aaron BeallCorrect answer
Inspiring
September 23, 2014

I think you can get the information you want by using URLLoader with a listener for HTTP_RESPONSE_STATUS and check the responseHeaders and responseURL properties:

HTTPStatusEvent - Adobe ActionScript® 3 (AS3 ) API Reference

-Aaron

http://abeall.com

rs14smithAuthor
Known Participant
September 23, 2014

Aaron, I think the route you mentioned the route I may give a shot. I see Adobe even has some example code that I should be able to figure out how to use in my application.

Fu, that sounds like a good idea too. I may go that route if Aaron's idea doesn't work.

Thanks guys