6 Replies Latest reply on Jun 16, 2011 3:05 PM by Peter Blazejewicz

    converting the web app into AIR app leads errors

    starter46

      Hi all,

      I am new to flex, i am trying to convert a web app into air app.

      I changes the tags and when i complie i get the below 3 error popups with dismis and continue buttons on the bottom right..

       

      Error: Error #2067: The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime.

       

      Error: Error #2067: The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime.

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.

       

       

      Any help would be greatly appreciated.

       

      Thanks in advance.

        • 1. Re: converting the web app into AIR app leads errors
          Peter Blazejewicz Level 4

          Hi,

           

          Well, run "Find" in your authoring tool and find where your code is using flash.external.ExternalInterface (your debugger window should also point where in source code ExternalInterface api is used - in which line and which source code file).

          Your application is facing stopper as flash.external.ExternalInterface.available returns *false* - there is no support for that api in Air runtime.

           

          regards,

          Peter

          1 person found this helpful
          • 2. Re: converting the web app into AIR app leads errors
            starter46 Level 1

            Thanks peter for the quick answer.

             

            i found these three lines that are using external interface in air

             

             

            ExternalInterface.addCallback("selectTabByName",selectTabByName);

            ExternalInterface.addCallback("getData",getData);

             

             

            plog.log( "External Interface Available: "+ExternalInterface.available);

             

            is there any way to alternate those lines to work in AIR?

            thanks in advance.

            • 3. Re: converting the web app into AIR app leads errors
              Peter Blazejewicz Level 4

              Hi,

               

               

              #1

              you could comment out these lines:

              // ExternalInterface.addCallback("selectTabByName",selectTabByName);

              // ExternalInterface.addCallback("getData",getData);

              They are in our code because e.g. when run in browser javascript could call "selectTabByName" and "getData" methods in your Flash movie. If you don't have external hosting page now and you're not sure about why there was integration with hosting web page - just comment them out: they are external to your application code (you could of course check what those methods do in your actionscript code)

               

              #2

              you could also comment that out:

              // plog.log( "External Interface Available: "+ExternalInterface.available);

              although that one is safe is it uses available api (that specific api feature is called runtime feature check) - so it should just log false into your logging util I think,

               

              hth,

              regards,

              Peter

              1 person found this helpful
              • 4. Re: converting the web app into AIR app leads errors
                starter46 Level 1

                Thanks peter.

                commenting those lines avoids the first 2 errors but still i am getting the below errors.

                this is a microstrategy flex project.

                Error #1009: Cannot access a property or method of a null object reference.

                at com.microstrategy.web.vf.viewer::MstrWindowedApplication/handleCreationComplete()[Z:\Flex \projects\VisFrameworkAIR\src\com\microstrategy\web\vf\viewer\MstrWindowedApplication.as:9 9]

                at flash.events::EventDispatcher/dispatchEventFunction()

                at flash.events::EventDispatcher/dispatchEvent()

                at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src \mx\core\UIComponent.as:9298]

                at mx.core::UIComponent/set initialized()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as :1169]

                at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects \framework\src\mx\managers\LayoutManager.as:718]

                at Function/http://adobe.com/AS3/2006/builtin::apply()

                at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framew ork\src\mx\core\UIComponent.as:8628]

                at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framewo rk\src\mx\core\UIComponent.as:8568]

                • 5. Re: converting the web app into AIR app leads errors
                  Peter Blazejewicz Level 4

                  Hi,

                  you would find answer in line 99 of:

                  com.microstrategy.web.vf.viewer.MstrWindowedApplication

                  Within "handleCreationComplete" method the code tries to use object that is "null" (or undefined) - so it has no methods nor properties.

                  (there could be more dependencies in your 3rd party framework that are required to export workable flash content I think)

                   

                  regards,

                  Peter

                  • 6. Re: converting the web app into AIR app leads errors
                    Peter Blazejewicz Level 4

                    Hi,

                     

                    Everyday brings something new to learn (it appears one of my friends is working in Microstrategy Poland) . Do you have account on microstrategy (BI solutions) developers zone?
                    http://www.microstrategy.com/Support/supportsite.asp

                    regards,

                    Peter