We will script frame events that are activated when the timeline gets to
the frames which have the frame actions in them. We will communicate between
the main timeline, or _root, and movie clips, and from movie clips back to
the main timeline.
You will need this file to
complete this tutorial. This is a flash mx 2004 file
1. Open your movie file. Review the contents of this movie. There are 5
layers.
One for the background scene, including the name of the company.
Then you have the slide show layer. Double click the movie clip that
looks like a photograph. You will see a movie clip with several keyframes,
each containing a photo. These are masked to confirm to the shape on the
stage. There is also an actions layer where each frame is a separate
keyframe.
The entrées text box layer contains a dynamic text box.
The transition layer contains a transitioning animation to play as the
slide changes
An actions layer is at the top of the main timeline.
2. Naming instances:
Highlight the slide show movie clip. Give this movie clip an instance
name of slideshow_mc..
Highlight the entrées text box. give the text box an instance name of
entre_txt.
Highlight the blank movie clip appearing as a small white circle in
the upper left side of the movie, just off stage. Give the transition
movie clip an instance name of transition_mc.
3. When the slide show slide changes, we want the entree text box to
change what it says. Open the slideshow move clip. Click in frame 1 of the
actions layer. Open your actions panel.
Add a stop(); to the actions panel. Go to the next line and assign the
entre_txt box on the main timeline, or _root, to say the name of the entre,
in this case, hearty bean soup. Your script for frame 1 of the slideshow
move clip should say the following:
In frame 2, we just need to change the entre text to say Fettuccine. Use
the following script in frame 2:
_root.entre_txt.text = "Fettuccine";
In frame 3, we just need to change the entre text to say Fresh Fruit. Use
the following script in frame 3:
_root.entre_txt.text = "Fresh Fruit";
In frame 4, we just need to change the entre text to say Cheese & Fruit
Plates. Use the following script in frame 4:
_root.entre_txt.text = "Cheese & Fruit Plates";
In frame 5, we just need to change the entre text to say Steak and Fries.
Use the following script in frame 5:
_root.entre_txt.text = "Steak and Fries";
In frame 6, we just need to change the entre text to say Shish-Ka-Bob.
Use the following script in frame 6:
_root.entre_txt.text = "Shish-Ka-Bob";
In frame 7, we need to tell the clip to return to frame 1 and stop. Use
the following script in frame 7:
gotoAndStop(1);
4. Return to the main timeline. We need to tell the main timeline to move
the slideshow movie clip to the next frame. Click in the last frame, frame
60 of the actions layer, of the main timeline. Target the slideshow_mc
movieclip and tell it to go to the next frame using the following script:
slideshow_mc.nextFrame()
This script will advance the slideshow movie clip to show the next image,
and set the new text. When it gets to the end of the slideshow timeline, the
script is there to move the slideshow timeline back to frame 1.
5. We can transition the slides by activating the 12 frame transition
movie clip. Click in frame 48 of the main timeline actions layer. There is
already a keyframe there. There are 12 frames left in the movie, and this
coincides with the transtionin movie clip having 12 frames left. In this
keyframe, you are going to tell the target movie clip of transition_mc to
play. Use the following script: