Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jashsayani

macrumors 6502
Original poster
Feb 7, 2009
299
130
Redwood City, CA
Sorry for posting Adobe AIR questions here, but its a part of Mac programming and Adobe forum has no activity at all.

I have made an app that displays a html file. I have also made a javascript file with the following code (Does not work):

Code:
air.URLLoader(air.URLRequest("http://www.website.com/"));

When the js is called, I want the window to navigate from the html file to the URL (website.com).

Any ideas on how do I do this ??


Thanks.
 
It depends on where you're trying to show the link.

If you want it to open in a new window:

Code:
navigateToURL(new URLRequest('http://www.website.com'));

Or, in an existing HTML element:

Code:
myHtmlElement.location = 'http://www.website.com';

Note that the second code snippet crashes my quick-test Air app, but I think that's how it should work.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.