[Adobe AIR] Basic HTML and JS help

Discussion in 'Mac Programming' started by jashsayani, Feb 9, 2009.

  1. macrumors regular

    jashsayani

    Joined:
    Feb 7, 2009
    Location:
    San Jose, CA
    #1
    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.
     
  2. macrumors 6502

    Joined:
    Jan 16, 2008
    Location:
    Nottingham, England
    #2
    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.
     

Share This Page