4 Replies Latest reply on Mar 2, 2011 12:33 AM by Christian Giordano

    air.trace() not working

    AJamesPhillips Level 1

      Hi all,

       

      Someone had a similar problem here: http://forums.adobe.com/thread/750219?tstart=0  They managed to solve it, I started adding to post but thought it best to start a brand new post.

       

      I've tried what they've suggested and made a file called mm.cfg in my %HomeDrive%%HomePath% directory (c:\users\james) the contents of which are:

       

           ErrorReportingEnable=1
           TraceOutputFileEnable=1
           TraceOutputFileName=c:\logs\flashlogs.txt
           MaxWarnings=50

       

      but I still don't get a log file from air.trace().  Though in C:\Users\James\AppData\Roaming\Macromedia\Flash Player  there's a file flashlog.txt with:

           Warning: Not a known player download type, app:/HelloWorld.html

       

      I'm running Vista and I'm using AIRSDK 2.5.  I call my hello world  application from the command prompt with " adl HelloWorld-app.xml "  I  get a window of correct dimensions with " Hello World! " as expected, but  no console message.  What am I doing wrong please?  I've been looking  for about a day now at how to get the air.trace messages but neither  those nor the introspector statements work.

       

      Thank you!!

      James

       

       

       

      The  4 files are in:

      C:\AIRHelloWorld

       

      The 4 files are:

      HelloWorld-app.xml

      HelloWorld.html

      AIRAliases.js

      AIRIntrospector.js

       

       

      My  code for HelloWorld-app.xml and HelloWorld.html is below.   AIRAliases.js and AIRIntrospector.js  are copied straight from AIRSDK

       

      HelloWorld-app.xml

       

      <!-- Tutorial at: http://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118666ade46-7ecc.html -->

       

      <application xmlns="http://ns.adobe.com/air/application/2.5">

       

          <id>examples.html.HelloWorld</id>   
          <versionNumber>0.1</versionNumber>   
          <filename>HelloWorld</filename>
          <initialWindow>
              <content>HelloWorld.html</content>
              <visible>true</visible>
              <width>240</width>
              <height>320</height>
          </initialWindow>

       

      </application>

       

       

       


      <!-- To RUN AND TEST the application get a console window (type cmd into search box of Windows vista)
      type:
      cd c:\AIRHelloWorld

       

      When you have it in the directory of "c:\AIRHelloWorld" then type:
      adl HelloWorld-app.xml

       

      You'll get a window showing the app and also apparently the console window displays the
      message resulting from the air.trace() call in the html, but I never see this -->

       

       

      HelloWorld.html

       

      <html>
      <head>
          <title>Hello World</title>
          <!-- In the <head> section of the HTML, import the AIRAliases.js file: -->
          <script src="AIRAliases.js" type="text/javascript"></script>
          <script type="text/javascript" src="AIRIntrospector.js"></script>

       

          <!-- JavaScript function to handle the onLoad event:  -->
          <script type="text/javascript">
          function appLoad(){
              air.trace("Hello World - debug comment");  /*The appLoad() function simply calls
                 the air.trace() function. The trace message print to the command
                 console when you run the application using ADL. Trace statements
                 can be very useful for debugging.*/

       

              air.Introspector.Console.log("Hello World - Introspector debug comment");
        
          }
          </script>


      </head>
      <body on load="appLoad()">
          <h1>Hello World!</h1>
      </body>
      </html>

        • 1. Re: air.trace() not working
          AJamesPhillips Level 1

          Any comments or help, anyone?  Please?!

          • 2. Re: air.trace() not working
            chris.campbell Adobe Employee

            Hi,

            I'm sorry for the delay.  I ran into the same problem you did (using a mac.)  I could get air.Introspector.Console.log to work properly, but trace wasn't outputting to my terminal window.  I've asked our webkit team to take a look so hopefully I'll know more shortly.  I'm assuming it's something simple that we're missing.

             

            Thanks,

            Chris

            • 3. Re: air.trace() not working
              Harry Kunz Level 4

              I was trying to get trace() to work in Mac. I compiled my AIR app using the flex command line compiler "amxmlc" and included parameters -debug=false and -omit-trace-statements=false. Then i ran the application with adl your-app.xml -nodebug and i was able to get the traces into terminal.

              • 4. Re: air.trace() not working
                Christian Giordano Level 1

                Hi Chris, on sdk 2.5, actually, also the Introspector doesn't seem to work. Tried:

                 

                <html>

                    <head>

                        <title>Source Viewer Sample</title>

                        <script type="text/javascript" src="js/AIRAliases.js"></script>

                        <script type="text/javascript" src="js/AIRIntrospector.js"></script>

                        <script type="text/javascript">

                            function logBtn()

                            {

                                var button1 = document.getElementById("btn1");

                                air.Introspector.Console.log(button1);

                            }

                        </script>

                    </head>

                    <body>

                        <p>Click to view the button object in the Console.</p>

                        <input type="button" id="btn1"

                            onclick="logBtn()"

                            value="Log" />

                    </body>

                </html>

                 

                UPDATE: I didn't realize it was a different window that appears behind. It works then!