createEmptyMovieClip

As I have mentioned: there are often multiple strategies to produce the same end result. For some people, it doesn't make sense to use a for loop in the onEnterFrame function to rotate each of these MovieClips individually. Why not just put all of the MovieClips inside one MovieClip, then rotate that?

That's what we are going to do right now, and in the process, learn a new ActionScript skill: createEmptyMovieClip

We want an empty container to hold all of the lines. You can Insert a New Symbol, set up the Linkage and use the attachMovie Action. Or you can consolidate those steps, and keep the Library clean, using a great built-in Action Script function: createEmptyMovieClip

  1. We want this to happen ONE TIME, at the start of the init function, and outside the for loop
  2. Choose ActionScript 2.0 Classes > Movie > MovieClip > Methods > creatEmptyMovieClip
  3. This new Movie Clip is going on the main stage, so the Object is _root
  4. Set the New Name to container (You can name it whatever you want, as long as it's "legal")
  5. Set the Depth to 1

Center the new container MovieClip on the stage the same way you centered the lines. In fact, you don't need to center the lines anymore (they are going inside the container) so move the actions up and out of the for loop, then replace line with container:

Now when the for loop runs, you want to attach all of the line Movie Clips to the container Movie Clip, not the stage. Just change the Object from _root to container:

Finally, edit the onEnterFrame function. You no longer need the for loop, because you aren't rotating each of the lines individually - you are rotating the container: