0

In my application I tried using following codes to do this:

<mx:HTML x="0" y="0" width="100%" height="100%" location=“http://www.example.com”/>

The page is loaded fine.But when I click the links I found sometimes there was no any response while I need a new explore window opened with the linking url.And also I tried:

<mx:Script>
<![CDATA[
private function init():void
{
 var req:URLRequest = new URLRequest("http://www.baidu.com");
  var a:HTMLLoader = new HTMLLoader();
  a.width = 400;
  a.height = 300;
  a.load(req);
  htmlmc.addChild(a);
}
]]>
</mx:Script>
<mx:HTML x="10" y="10" width="345" height="258" id="htmlmc"/>

But still got nothing.Any good ideas?

Thanks in advance!

1 Answer 1

1

If your question is "how to open a link in new web browser window by click it in Adobe AIR?", please try this solution.

  1. Give "id" to your HTML component. (I give its "box" in this case.)
  2. Add this code to your application's creation complete handler.

Use following function:

protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
{
    box.htmlLoader.navigateInSystemBrowser = true;
}

Run your application and try to click on a link. This should work. I tested it with Adobe Flash Builder 4 on Windows 7. It works like a charm.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.