Skip to main content
Participating Frequently
April 30, 2013
Question

Is it possible to use HTMLLoader on android in air application?

  • April 30, 2013
  • 3 replies
  • 1222 views

Hello,

I need HTML support and JavaScript<->Air interaction.

I tried to use HTMLLoader. It's compiled, but seems doesn't work, because HTMLLoader::load() && HTMLLoader::loadString() do nothing.

Thanx.

This topic has been closed for replies.

3 replies

April 30, 2013

AIR Desktop: yes

AIR Mobile: no

Alternative for mobile (havent tested this myself):

StageWebView + StageWebViewBridge

https://code.google.com/p/stagewebviewbridge/

4xyfenixAuthor
Participating Frequently
April 30, 2013

Is it possible to use it from within flash builder, not creating .fla project?

I tried to use it like this, unfortunately the code doesn't work...

        addEventListener(Event.ADDED_TO_STAGE, function (e: Event): void

          {

            //_web_view.stage = stage;

         

            var c: UIComponent = new UIComponent();

            c.addChild(_web_view);

            addElement(c);           

         

            _web_view.viewPort=new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);           

            _web_view.addEventListener(ErrorEvent.ERROR, function (e: ErrorEvent): void { trace("ERROR"); } );

            _web_view.addEventListener(LocationChangeEvent.LOCATION_CHANGING, function (e: LocationChangeEvent): void { trace("LOCATION_CHANGING"); } );

            _web_view.addEventListener(Event.COMPLETE, function (e: Event): void { trace("COMPLETE"); } );

           

            _web_view.loadURL("http://www.adobe.com/");

          });

April 30, 2013

First, check if it is possible at all on your device.

StageWebView.isSupported

You dont have to add stageWebView to a DisplayObject or UIComponent, it is not in the usual-display-tree, its always shown on top of everything.

If you set the stage + viewport, its visible, no addChild() required.

webView.stage = this.stage;

or

webView.stage = FlexGlobals.topLevelApplication.stage;