How onClipEvent scripts affect tweened movieClips part 2
ericlin@ms1.hinet.net


Again, we are going to discuss the load and unload principles in tweened movieClips.

The rule is still the same:

When movieClips have different onClipEvent block, they are reload and all variables are reset.

This is the movie described in part 2. A simple tween of a square movieClip with dynamic box in it.

Nothing special.

Now, we are going to add script to frame 1, set 

mc.txt=0;

Here, we see the animation going smoothly and the textbox remained to be 0 during the tween; "It" passed through all keyframes without reload. Later we will make "it" to be "them";

OK, here in the first keyframe, I select the movieClip and press ENTER key to add a blank line without real commands. In movie explorer, we see nothing. No action script is assigned to movieclip symbol. However, now one of the three movieClip (in 3 keyframes) has "something" in the onClipEvent block now. We expect it will be treated as different clip and reload is expected. All the variables will be reset.

Here is the movie:

download zipped fla of these movies

Conclusion:

1. If you edit onClipEvent block of a tweened clip, be sure they have completely the same onClipEvent block. You do it by copy and paste.

2. If you want onClipEvent block to be different, then you must think it as reload , fresh new clip. All variables need to be reset or re-get.

3. If you want tween behave like a tween without reload, it is better let onClipEvent block completely blank. To edit it is troublesome, because its effect to all keyframes later. Just make it a simple tween without scripts.