Skip to main content
Inspiring
May 7, 2019
Answered

WebStageView - route JavaScript console.log to trace()

  • May 7, 2019
  • 1 reply
  • 348 views

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

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer PippoApps

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.

1 reply

PippoAppsAuthorCorrect answer
Inspiring
May 7, 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.