Change MovieClip Timeline

game

Flash won't let you change the timeline in which a movie clip exists once its there. The only way you can really achieve this effect is to use removeMovieClip and attachMovie to remove the original and create a new copy of that symbol from the library into the new desired timeline. Doing so, however, means you lose all properties associated with that movieclip as attaching a movie "resets" it to a default size, location etc. and without any variables you may have defined it to have before attempting to change its timeline.

This file uses a class called FreeRangeMovieClip to help you manage the aforementioned transition of a movieclip from one timeline to the other. The result is an almost seemless transition. You will hardly know the movieclip has changed timelines. Just drag the rotating gears onto another movieclip on the screen and see if you can tell.

By default, as this example is set up, a movieclip is added to another timeline without that timeline's transformations applied to the clip at the time of change (further transformations will continue to affect the clip). You can turn this off using the checkbox at the bottom.

Now, this techniuque isn't 100% (for example movieclips within movieclips moved will start back at playing frame 1), and none probably will be, but its a start to help you do some of the simpler tasks where you may feel the overwhelming need to change a movieclip's location from one timeline to another.

Developer: Trevor McCauley
Language: en