Subtleties of Movie Clips

 < Day Day Up > 

We've already discussed the biggest difference between Movie Clip symbols and Graphic symbols a movie clip's Timeline is independent. Obviously, there's more. Movie clips are addressable, in that you can use ActionScript to direct messages to individual instances of a movie clip, such as a Stop command. Also, Movie Clip instances download in a different manner than Graphic instances.

Addressable Movie Clip Instances

Remember that the Properties panel provides a place to name a movie clip instance (see Figure 12.4). What's the point of naming an instance if the symbol already has a name in the Library? It provides a way to give each instance on the Stage a unique name. Only then can you address individual movie clips. Think about how you address a person. You first say his name, and then you tell him what you want. If you want him to stop, you say, "Joe, stop." This is the concept of addressing, which we'll talk about more in Hour 15.

Figure 12.4. The Properties panel, when set to Movie Clip, gives you a way to name a particular instance on the Stage.


Do you recall how the movie clip kept animating even when you stopped the Timeline in the last task? Stopping the Timeline is like yelling "Stop!" into a crowd. Simply saying "stop" isn't enough. You have to say, "Hey, Movie Clip 1, you stop." But you can't talk to an individual instance unless that instance has a name. As you'll soon see, you can do much more than tell movie clips to stop.

By the Way: Instance Names Versus Symbol Names

Don't confuse the master name for a symbol in the Library with the instance name for just one instance on the Stage. Every item in the Library must have a unique name, but symbols in the Library exist just once. You can drag as many instances of a symbol as you need to use throughout a movie. Any instance set to Movie Clip can be given its own instance name, regardless of the properties of the master in the Library. If the instance name is unique (that is, different from any other instances), you can address it directly. People often think that because the master in the Library has a name, the instance does, too. The truth is that an instance has no default name (and you'll see gray text reading "<Instance Name>" in the Properties panel).


Effects on Download Order

All this trash talk about graphics shouldn't scare you off. Besides being totally appropriate for scrubbing, they also have a nice effect on downloads. Specifically, Graphic symbols only need to download one frame at a time and therefore exhibit a better streaming effect than Movie Clip symbols. That is, a movie that uses Graphic symbols (or even no symbols) can begin to play before it's entirely downloaded. In the case of a frame containing a movie clip, all nested frames need to download before Flash will proceed to the next frame. If Flash reaches a frame that contains a ton of Movie Clip instances which in turn include lots of nested frames, you'll experience a pause. Even though the later frames in nested clips may not be needed right away, Flash needs to be prepared for a script that immediately jumps to the last frame. This isn't a super-critical point because Flash files tend to be very small, and there are other ways to optimize a movie (many of which are discussed in Hour 21). I just thought it would be worth mentioning at this point how Graphic symbols stream better.

     < Day Day Up > 


    Sams Teach Yourself Macromedia Flash 8 in 24 Hours
    Sams Teach Yourself Macromedia Flash 8 in 24 Hours
    ISBN: 0672327546
    EAN: 2147483647
    Year: 2006
    Pages: 235

    Similar book on Amazon

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net