1 Reply Latest reply on Jul 4, 2012 7:32 AM by Mali[x]

    Air Application freez after generation?

    Mali[x]

      Dears,

       

      I create Flex project than Action Script file,

       

      in this file i create this function

       

      private function ReadDataFromDB(dbRead:String):ArrayCollection

      {

          var dbReaded:File = File.applicationDirectory.resolvePath(dbRead);   

          var dbcon:SQLConnection =new SQLConnection();

          var readtable:SQLStatement = new SQLStatement();

          var Resultat:SQLResult = new SQLResult();

             

          dbcon.open(dbReaded);

          readtable.sqlConnection = dbcon;

          readtable.text = "select * from tprule_table;";

          readtable.execute();

          Resultat = readtable.getResult();

          var res:ArrayCollection = new ArrayCollection(Resultat.data);

          dbcon.close();

          return res;

      }

       

      I populate variables with it eg :

      [Bindable] public var C_ProjectType_R:ArrayCollection = ReadDataFromDB("tprules.db");

       

      My problem is :

      it's work when i excute it from fb 4.6

      but the air program generate function Export realease build ... dosn't work and it's 24 Mb on windows task Manager

       

      What I can do ?

       

      Thank's for help

        • 1. Re: Air Application freez after generation?
          Mali[x] Level 1

          Dears,

           

          I resolve problem by populating variables inside the function

           

          [Bindable] public var C_ProjectType_R:ArrayCollection;


          private function ReadDataFromDB(dbRead:String):Void

          {

              var dbReaded:File = File.applicationDirectory.resolvePath(dbRead);   

              var dbcon:SQLConnection =new SQLConnection();

              var readtable:SQLStatement = new SQLStatement();

              var Resultat:SQLResult = new SQLResult();

                 

              dbcon.open(dbReaded);

              readtable.sqlConnection = dbcon;

              readtable.text = "select * from tprule_table;";

              readtable.execute();

              Resultat = readtable.getResult();

               C_ProjectDomain_R = new ArrayCollection(Resultat.data);

              dbcon.close();

          }

           

          Thanks