Why Loops Are Useful
Loops enable Flash to perform an action (or set of actions) repeatedly, which means that with just a few lines of ActionScript, you can force an action to be executed several thousand times. In ActionScript, you use loops for tasks that would be difficult or impossible without loops. For example:Creating dynamically generated drop-down listsValidating dataSearching textDynamically duplicating movie clipsCopying the contents of one array to a new arrayDetecting collisions in games between projectiles and objects
You can use loops to automate any number of tasks, such as dynamically creating movie clip instances. Suppose your project called for 100 evenly spaced instances of the same movie clip. You could drag one instance from the library and then create a four- or five-line looping statement to duplicate the instance 100 times and position each duplicate on the stage automaticallya great improvement over dragging 100 instances from the library and aligning each one manually.
