O'Reilly logo

ActionScript 3.0: Visual QuickStart Guide by Derrick Ypenburg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 14. Iteration and Repetition

Looping logic consists of iteration and repetition. Loops are control structures used to count (iterate) through a data structure. With loops, we can write code once and use it many times to repeat a set of actions. Loops allow us to accommodate for variations in data that we simply cannot plan for ahead of time. For instance, an array in an application may begin with three elements. After certain events take place in the application, the array length grows to five elements.

We do not know what scenarios might take place ahead of time, so it’s hard for us to program the number of elements to get from an array if we do not know the array’s length. Loops handle those types of scenarios for us, so we do not have ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required