• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. The Movie Clip Object > Referencing Clips and Addressing

Referencing Clips and Addressing

Now that you know about accessing a clip’s properties, variables, and methods, you need to make sure that you address (or “target”) the correct clip. Although Chapter 1 offered a general discussion of addressing, it won’t hurt to revisit the topic and apply it to what you’ve learned in this chapter. Basically, you can set/get properties and variables or assign methods to any clip you want—you just need to be clear which clip (or which timeline) you are addressing.

Relative and Absolute Referencing

The section on addressing in Chapter 1 was extensive in covering the concept. Now we’ll look at addressing (or referencing) clips very specifically. As anyone who’s studied physics knows, “Everything is relative.” When you’re in a car driving beside a train, it can seem as though the train is barely moving—or even moving backward. The train could be going backward relative to your perspective, when in fact relative to the Earth, the train is moving forward quite fast— just not as fast as your car. The concept is called frame of reference, or starting point. “Frame of reference” applies to Flash when you think about a script’s starting point. If you put a script in a keyframe, your starting point (the “this,” if you will) is the timeline in which the keyframe resides. If that’s inside a clip, your starting point is the timeline inside that clip. Placing a script on a button is similar to keyframes because your starting point is the timeline where the button is placed. It gets a little weird when you place a script on a clip instance. A scripts on a clip instance behaves the same as though it were in the clip (like a keyframe or button in that clip). It makes sense when you think about it, but it’s also easy to incorrectly assume that you’re starting at the timeline in which the clip is sitting. Figures 7.6 and 7.7 show how frames of reference work.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint