Preparing for the Quicktip Interactions
In this task, you'll build two nonlinear groups of interactions. One is the Tooltip-like interaction, in which users roll over screen elements. The second is the scrolling text area, which provides information when a user clicks one of the labels on the map.You'll build the quicktip interactions first. These interactions are typical of the way Flash objects can be integrated to create nonlinear interactivity with a minimum of ActionScript. Each interaction will make use of three objects: a button, a movie clip, and a dynamic text field. More specifically, the movie will have many buttonsone for each hotspot/quicktip you want to createbut only one movie clip and one text field. The text field will be nested inside the movie clip.You worked with buttons in Lesson 10, Preparing the Dante Site . You might have less experience working with movie clips and dynamic text fields.
Introducing Movie Clips
Movie clips are one of the three types of Flash symbols, the other two being graphic and button symbols. Movie clips are created the same way as graphic symbols (you can go through Insert > New Symbol or convert an existing element to a movie clip symbol), they reside in the Library, and you can create instances of them by dragging the symbol from the Library to the stage.Of the three types of Flash symbols, movie clips are by far the most powerful, flexible, and interesting. You can think of a movie clip as an entire Flash movie encapsulated inside another Flash movie. A movie clip has the following key features:Its own timeline and stage. Anything you can put in a Flash movie, you can put in a movie clip (including other movie clips). You can embed video, create lengthy animations, or create complex ActionScript functionality inside movie clips.Timeline independence. Movie clip timelines run independently of all other timelines. So if a movie clip with a 100-frame animation is inside Frame 1 of the main timeline, for example, and the main timeline is stopped in Frame 1, the movie clip animation will still play back all 100 frames.Exposure to ActionScript. Movie clips tap into one of the richest classes in ActionScript, the MovieClip class, which has dozens of built-in events, properties, and methods that you can easily take advantage of in ActionScript, even if you are not a programmer.
Movie clips have many other features and capabilities, but these key features provide an idea of the power available to developers.
Introducing Dynamic and Input Text Fields
Now let's take a closer look at dynamic text fields. Flash has three different types of text fields: static, dynamic, and input.Static text fields the defaultdon't do anything and can't change. You type text into the text field and the text stays the same from that point forward, unless you manually change it in the authoring environment.Dynamic text fields have instance names and therefore are visible, or exposed, to ActionScript. Their contents and even formatting can be changed via ActionScript at runtime. A single text field can display any number of different strings of text.Input text fields also have instance names, and are typically used for collecting data from the user and submitting the data to ActionScript (and beyond, such as to a database via ColdFusion).
Working with dynamic text is rewarding because it's both powerful and easy. The main thing to keep in mind is that a single text field is a container that can hold many different text strings. When you build dynamic text fields, you should have in mind the nature of the different strings. Are they body text? Headlines? Short, long, or mixed?The reason you need to ask these questions is that you typically format the text field as soon as you create it. All the strings put in the text field will inherit that formatting, with some flexibility. Generally, if the text field uses Arial size 10, all the text dynamically added to the text field will also be displayed in Arial size 10.NoteIt's possible to radically change the formatting of text in a given dynamic text field, thanks to ActionScript's TextFormat class. However, this requires additional coding and is often easily avoided. You create a dynamic text field the same way you create a static text field: you use the Text tool. You then specify what type of text field you want, using the Property inspector's Text Type drop-down, and give the new text field an instance name. At that point, you can control the text fieldfor example, populate it with actual textusing ActionScript.