Understanding Multiple Timelines
Every project includes a main timeline. But projects also include movie clip instances that have timelines of their own. You can use the loadMovie() action to add external SWFs to a project, thereby adding even more timelines. Therefore, a single project can have many separate timelines, all of which can act independently, with their own variables, properties, objects, and functions.However, these timelines can also work together: one timeline can control another. In fact, any timeline present in a scene can tell another present timeline to do something. (Timelines are considered present as long as they exist in the Player movie window. If a movie clip instance appears in your movie for 40 frames, it's considered presentand targetableonly during those 40 frames.)The communication lines for these movie elements are provided by target pathsaddresses to objects (movie clip instances, for example) that describe the overall area in which the object exists and narrow that area with each subsequent level. To better understand this concept, take a look at the following example. The target path to one of your authors would look something like this:
This target path contains four levels, separated by dots, with each subsequent level smaller in size and scope until you reach the target: Derek Franklin. This is what's known as an absolute paththe complete and absolute location of Derek Franklin here on Earth. If someone in Australia wanted to communicate with Derek (using a hypothetical communication system), he or she would use this absolute address.In addition to absolute target paths, there are also relative target pathsa slightly trickier concept to understand, so let's consider an example. If someone in Bloomington wanted to communicate with Derek (who is also in Bloomington), a lot of the information included in the absolute path would be unnecessary (country, state, city) because both people exist in a position relative to one another: Bloomington. The following relative path would suffice:Relative paths are powerful because they enable you to script a "chunk" of timelines to work together, in a unique way, based on their relationship. As long as these timelines' relative relationship remains the same, they'll continue to work togethereven if you move them to another location in your project, or to another project altogether.Think of a Flash project as a hierarchy of movies, where timelines exist within other timelines and where the main, or root, movie serves as the starting point (see the section titled "Targeting the Main Movie" on page 114). When timelines exist in a hierarchical structure, as they do in Flash projects, it is critical that you understand how to address, or target, a timeline using target paths.
DerekFranklin
You will use target paths not only to alter timelines but to access their data, functions, objects, and so on.
• Table of ContentsMacromedia® Flash MX 2004 ActionScript: Training from the SourceBy
Derek Franklin, Jobe Makar Publisher: Peachpit PressPub Date: November 19, 2003ISBN: 0-321-21343-2Pages: 636
Sure, you can use Flash MX 2004 without being a master programmer, but as any Flash developer worth his or her salt will tell you, you''''re not tapping all of its power unless you''''re taking advantage of its scripting language "ActionScript 2.0" which offers a more robust programming model and better object-oriented programming support than ever before. Here to take the fear factor out of learning it are Flash veterans and best-selling authors Derek Franklin and Jobe Makar, who demonstrate that scripting is an instinctual process you already know by translating real-life activities into ActionScript scripts. In these pages, you''''ll find methodologies and techniques for building over 40 real-life Flash ActionScript projects, including sample games, applications, Web sites, and more. New in this edition are coverage of ActionScript 2.0, Web services, Components, Printing, Video, and more. On the companion CD, you''''ll find all the project files and images you need to complete each project.