2 Replies Latest reply on Jun 25, 2012 4:14 AM by pajsopa123

    flash builder 4.6 - send batch data to server (php connected)

    stefanba Level 1

      Hi, I've recently downloaded flashbuilder 4.6 and started to develop my first mobile app.

      Just to explain the sense of my problem/question,  I'd like to manage a local database offline (insert data to a table) and manually sincronize it to a server database (push a button -> add records batch to table in server).

      Following tutorials I was able to manage a sqlite local database, I got the connection to server database (mySQL) with php and have Data/Services panel populated (services test works fine).

       

      Unfortunately I'm not able to send local data, batch to server. A few lines of code below (debugging I got no errors and no results).

      Something wrong on the code?

      Or did I take a wrong way to solve my problem?

       

      thanks in advance for interest

       

       

      protected function button_clickHandler(event:MouseEvent):void

      {

       

      var LocalDatabase:ArrayCollection = ... <loaded from sqlite database>

       

      var RecordToAdd: MydataTable;    //server data table to fill

       

      for (var i:int= 0; i<LocalDatabase.length; i++)

      {     

          RecordToAdd = new MydataTable;

          RecordToAdd.Field1= LocalDatabase[i].Field1;                                                  

          RecordToAdd.Field2 = LocalDatabase[i].Field2;

          ...                              

          createMydataTableResult.token = MydataTableService.createMydataTable(RecordToAdd);

          createMydataTableResult.token = MydataTableService.commit();

        }

      }