Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

WebStageView - route JavaScript console.log to trace()

Engaged ,
May 07, 2019 May 07, 2019

Hello there,

I am deploying an AIR app with a WebStageView containing some maps.

So far, in order to test JavaScript I need access to logging. window.console.log is not available inside AIR WebStageview.

Any hint how to route console.log to AS trace output?

cheers

TOPICS
Development
313
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , May 07, 2019 May 07, 2019

I managed with this JavaScript:

if (!window.console) {

   window.console = {

   log:function(s) {

   window.location = "trace:" + s;

  }

  }

}

And intercepting location change in ActionScript, if "trace:" is at the beginning, just route to trace();

In this fashion I can debug both in AIR and in browser.

Translate
Engaged ,
May 07, 2019 May 07, 2019
LATEST

I managed with this JavaScript:

if (!window.console) {

   window.console = {

   log:function(s) {

   window.location = "trace:" + s;

  }

  }

}

And intercepting location change in ActionScript, if "trace:" is at the beginning, just route to trace();

In this fashion I can debug both in AIR and in browser.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines