0 Replies Latest reply on Nov 11, 2009 5:43 PM by jayuzzz

    Problem with flash player and air.swf


      Hi all,
      I am new here, could someone help me?


      I am trying to make automatic launch air app from browser. So, when I am loading a web page, the web page will automatically launc my installed air app. I am trying to load air.swf into load_swf.swf into same application domain.
      When I do that, I get this error :


      TypeError: Error #1009: Cannot access a property or method of a null object reference.
          at load_swf_fla::MainTimeline/load_swf_fla::frame1()


      After I read it again, guess I am placing wrong place to call air.swf API. Then I have move it to the correct place that is inside


      function onInit(e:Event):void {




      it's work but, it show another error when I call airSWF.launchApplication:


      Error: Flash Player 9,0,115,0 or later is required.
          at AIR/::ensureMinimumFlashPlayerVersion()
          at AIR/getApplicationVersion()
          at load_swf_fla::MainTimeline/onInit()


      it shows even when I am installed the latest version of the flash player. Have someone face it before? and how to fix this?
      I have try googling and follow the instruction here http://paragshah.wordpress.com/2008/06/28/flash-player-installation-woes-in-ie/
      and reinstall my flash player but it caused same error.


      I have try to another application like ebaydesktop on desktop.ebay.com, but it caused same error.


      as the reference, I am posting my action script :


      //ebay appId and pub id
      //var appID:String = "com.ebay.sandimas.public-beta";
      //var pubID:String = "AA1EEF5552BF52051F68E7EAF27E23FA6449A65C.1";
      //my appid and pub id
      var appID:String = "examples.html.HelloWorld";
      var pubID:String = "B71ED76ECC937067D72BB9A0CDB516D1A8F43A9E.1";
      var airSWF:Object;// This is the reference to the main class of air.swf
      var airSWFLoader:Loader = new Loader();// Used to load the SWF
      var loaderContext:LoaderContext = new LoaderContext();
      // Used to set the application domain
      loaderContext.applicationDomain = ApplicationDomain.currentDomain;
      airSWFLoader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
      airSWFLoader.load(new URLRequest("http://airdownload.adobe.com/air/browserapi/air.swf"),loaderContext);
      function onInit(e:Event):void {
          airSWF = e.target.content;
          var status:String = airSWF.getStatus();
          //this part doesn't work
          airSWF.getApplicationVersion(appID, pubID, versionDetectCallback);
          var version:String="0.1";
          function versionDetectCallback(version:String):void {
              if (version == null) {
                  trace("Not installed.");
                  // Take appropriate actions. For instance, present the user with
                  // an option to install the application.
              } else {
                  trace("Version", version, "installed.");
                  // Take appropriate actions. For instance, enable the
                  // user interface to launch the application.
          airSWF.launchApplication(appID, pubID);
          //end of part which don't work

      thanks in advance.