Thursday, November 19, 2009

Using the "root" function


For those of you working on your websites in Flash and using frames instead of scenes you may find this code very useful. If you have a nested movie clip and need to jump to back to a frame in the main timeline once it has completed playing, do the following:

On the actions layer inside the nested movie clip place a keyframe in the actions layer at the end of the timeline.

Insert the code:

MovieClip(this.root).gotoAndStop(4);

You do not need a stop; function. 4 is the frame number you'd like to jump back to on the main timeline. Therefore, you'd need to change that depending on what frame you want to call up.

No comments: