Attaching frame label to frames in the timeline is very useful and will save a lot of time when we want to alter (shift) frame positions in the timeline at later stages.
Click on color buttons to change colors of the frame
It is always a good idea to add frame lables in the timeline for movieclips or graphics placed on stage. You can refer name of the frame in the actionscript instead of the frame numbers. If we shift (unintentionally/accidentally) frames containing Movieclip/Graphics (attached with frame lables) still the action script will do its work since the frame labels remain with frames. However it is not applicable for frame numbers mentioned in actionscripts since the frame numbers change with displacement of Movie Clip/Graphics frames.
DownLoad Source File:
Download frameLables.zip and unzip.
Open frameLables.fla in flash.
noColor, colorBlue, colorGreen, colorRed are frame lables attached to Frames 1, 8, 15 and 23 respectively.
Equal sized Blue, Green and Red Squres drawn on stage at Frames 8, 15 and 23 respectively and noColor frame left blank (inserted a blank Keyframe).
Border for squares, Blue, Green, Red and NO COLOR buttons are placed on buttons layer and asigned instance names blue_btn, green_btn, red_btn and noColor_btn respectively.
And the following actionscript added to Frame 1 of actions layer.
Similar script woks when we insert Frame Numbers 1, 8, 15 and 23 for noColor, colorBlue, colorGreen and colorRed respectively for gotoAndStop action. But we need to alter the script if we have to shift the frame positions to new location so that attaching labels to frames will make our job easy. The stop(); action stops the move from playing until we click on any one of four buttons.
Download , unzip frameLables.zip and open with flash. Shift the frame labels of colors layer in the timelineto new loacation and check the movie.