Load this image for menu options!

Note: This is just a little stand-allone insight into one special feature of Flash 2. Knowledge bases and tutorials are growing slowly. Aside of the documentation on Macromedia's site, John Croteau's Flash Tech Resource is most comprehensive. You will even find a little movie there which illustrates "Wait for frame"...

To see "Wait for frame" in action, go to our Inter-Clip Showcase!

WAIT FOR FRAME - Complete Edition

  1. There is no way of assigning 'Wait for frame' directly to a button action (although the option is available!!!), but if you try to do that nothing happens - the movie jumps to the latest available frame if the target frame is not downloaded yet.
  2. 'Wait for frame' works much like an 'if...then' if you assign it to a frame action with Goto:
        if (wait_frame downloaded) {
                goto target_frame
        } else {
                keep going;
        }

where wait_frame = current frame + extra frames and target_frame is the frame that you enter in action-properties>Frame: (current frame = the frame where you insert the frame action, extra frames = Action-Properties>extra frames)

Now, two things are weird at that:

  1. 'wait' doesn't wait but keeps going if the condition is false
  2. 'extra frames' would relate more to something called 'Wait frames' than to 'Wait for frame'

So much for 'intuition'... However, knowing all that it's pretty clear what you need to do:

Let me do that with examples:

A: Say, you have a movie with 500 frames. You want to make sure that frame 300 is loaded before you start to play (the numbers are just for the sample - you'd have to test what works for you).

Solution:

  1. Insert a frame action 'Goto and Play' to frame 3; in the Action-Properties you put Frame: 5, extra frames: 297, and check 'Wait for frame'
  2. Insert a frame action 'Goto and Play' to frame 4, Action-Properties: Frame: 2 (nothing else!) This will loop your movie until frame 300 is downloaded, then the jump to frame 5 will be executed.

B: Say, you have a menu that is complete in frame 100 (after some initial animation). Your menu buttons jump to different frames later on in the movie. Now, you want to make sure that each button doesn't get displayed before its 'Goto-frame' is loaded.

Solution: Build a loop as in the first example before the frame that displays each button. (say in frames 102 and 103 for the first button - which will be displayed in frame 104)

Action-Properties:

  1. (for frame #102:) Frame: 104, extra frames: (target_frame_of_your_button minus 102), and check 'Wait for frame'
  2. (for frame #103:) Frame: 101, and nothing else (target_frame_of_your_button is the frame that you enter in the button action 'Goto...')

Note: If you use multiple scenes, the frames just keep counting. If you Export Movie... with 'Generate Size Report' enabled, you get a nice sheet where the running frame numbers are in the first column, and each scene has its tag in the corresponding row in the last column.

Since the entire procedure can be quite a hassle, you should not want to change anything at your movie after you insert the 'Wait for frame' stuff! Otherwise, you'll have to do it all over again, because the numbers that you've entered don't follow your changes...

New (09/15/97):

You can also use "Wait for frame" to avoid that an intro of a movie that ends with a menu plays again when your vistor comes back to the movie after having browsed one of the menu options. (A common problem is that IE and NN handle this situation differently. However, with "Wait for frame" you can easily overcome the differences without scripting!)

Here's how:

  • Put about 10 empty frames in the beginning of the movie.
  • In frame 8:
    • insert a frame action "Goto (and Play)" frame: [the number of the frame where your menu is fully assembled, or from where you want the movie to play the second time someone sees it],
    • check "Wait for frame", put [number of frames in your movie - 8] in "frames".

That's it! No loop in this case, since you want to continue to play and load the movie if it's not cached.


Copyright © audiohost.com 1997, all rights reserved.
What can we do for you? Watch, listen and interact! It's all about sound! Download browser add-ons 2 pages ready to print! Contact Audiohost