0 Replies Latest reply on Sep 15, 2009 7:21 PM by alan_lindsay

    Flash 8 AS2 - How to get round the asynchronous structure

    alan_lindsay Level 1

      I use CFC's via CF8 to interact with an Access db. In 1 screen (swf) of my application, I have to update up to 7 records depending on whether a screen field was filled in and each of these updates is an identical activity. Ideally, my code might look something like this:

       

      for(var i = 1; i < 8; i++)

      {

           if (fieldi != "")

           {   

                update_record (using key in fieldi);

           }

      }

       

      I want to check that each update has completed successfully before continuing with the next but the loop won't wait for a return from the update_record function before continuing on.

       

      How can I achieve my objective?