Think of something that you wish Authorware could do but it doesn't?  Let the our good friends at Macromedia know via the wishlist.

Please let us know if you find any of the materials on this site inappropriate or offensive. Please include the url and why the material should be reviewed.

Comments and questions about the site are also welcome. Please no Authorware questions, use the AWARE list.

Back

C1003 - Why is my screen not updating when I'm using a Repeat loop?

by - Joseph Ganci


I'm trying to get an icon moving on a grid, with the X and Y grid position taken from the array. As X expression I use 

    ArrayGet(IconTitleShort(IconParent(IconID))*25 + 1) 

The Display icon (and grid) are in a map icon with name '0' (there are others, which I try to move all at once, using a repeat loop to update the array). The array contains 25 elements per object, with X at offset 1.

However, the object does not move. I put the above expression in the object itself (with 'Update displayed variables' true) and the value of the array variable does not change. When I look at the display icon itself in the flow line, the updated value _is_ shown on the canvas. Any clue what I'm doing wrong? 

When you execute a Repeat loop, everything else stops.  Perpetuals options will not respond, and most other things will pause as well until the repeat loop is done. Trying to update screen information from within a repeat loop does not work for this reason.  This is how repeat loops work so quickly, they don't allow other pieces to interfere with their processing. Thus, they should be used primarily for calculation intensive processes and not for controlling screen elements.

However, there is a way to get Repeat loops to pause each time through the loop and let Authorware look around and exclaim, "Anyone need anything?" To do so, place the following two script lines inside the Repeat loop:

SyncPoint(0)
SyncWait(0.1)

This tells Authorware to pause immediately for one-tenth of a second. During this time, it can update displayed varialbes, see if perpetuals need some attention, and address any other needs.

There are 0 reviews
Add your review
Back