# Controlling the execution flow

**URL:** <https://forum.kirupa.com/t/controlling-the-execution-flow/296939>\
**Category:** flash\
**Created:** [September 23, 2009, 2:23am UTC](https://forum.kirupa.com/t/controlling-the-execution-flow/296939 "2009-09-23T02:23:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![newtome](https://avatars.discourse-cdn.com/v4/letter/n/c4cdca/32.png) [@newtome](https://forum.kirupa.com/u/newtome)\
**Post date:** [September 23, 2009, 2:23am UTC](https://forum.kirupa.com/t/controlling-the-execution-flow/296939/1 "2009-09-23T02:23:17Z")

</div>

Folks, I hope that the active membership of this forum don’t see this as difficult a question as another did. I’m relatively new (12 months) to this programming language and this is all part of my learning, so help me develop.

I use CFC’s via CF8 to interact with an Access db. In 1 screen of my Flash8 application, I have to update up to 7 rows in a table 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.

How do get around this asynchronous behavior and maintain a concise mainline structure?
