MACROMEDIA DIRECTOR MX 2004-USING DIRECTOR Using Manual

Other manuals for DIRECTOR MX 2004-USING DIRECTOR: Using Manual, Using Manual, Using Manual, Using Manual, Using Manual

Summary of DIRECTOR MX 2004-USING DIRECTOR

  • Page 1

    Director ® mx 2004 using director.

  • Page 2

    Trademarks activeedit, activetest, add life to the web, afterburner, aftershock, andromedia, allaire, animation powerpack, aria, attain, authorware, authorware star, backstage, blue sky software, blue sky, breeze, bright tiger, clustercats, coldfusion, contents tab composer, contribute, design in mo...

  • Page 3: Contents

    3 contents chapter 1: introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 about director . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 what’s new in director mx 2004 . . . . . . . . . . . ....

  • Page 4

    4 contents chapter 3: sprites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 creating sprites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 setting sprite general preferences . . . . . . . . ...

  • Page 5

    Contents 5 using bitmap filters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 using onion skinning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 about the paste as pict option . . . . . . . . . . . . ....

  • Page 6

    6 contents chapter 9: using flash, flash components, and other interactive media types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 using flash content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 adding a flash cont...

  • Page 7

    Contents 7 chapter 11: using digital video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 about digital video formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 using the video windows. . . . . . . . . . . . . . . . . . . . . . ...

  • Page 8

    8 contents chapter 14: 3d basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 what you need to know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 about 3d in director mx 2004 . . . . . . . . . . . . . . . . . . . ...

  • Page 9

    Contents 9 chapter 17: controlling the 3d world . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 3d lingo or javascript syntax events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 collisions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....

  • Page 10

    10 contents chapter 23: packaging movies for distribution . . . . . . . . . . . . . . . . . . . . . . . 447 about distributing movies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 shockwave browser compatibility . . . . . . . . . . . . . . . . . . . . . . . ...

  • Page 11: Chapter 1

    11 chapter 1 introduction welcome to macromedia director mx 2004. With director, you can develop high-performance multimedia content and applications for cds, dvds, kiosks, and the internet. This guide, using director, includes comprehensive descriptions and detailed step-by-step instructions that e...

  • Page 12

    12 chapter 1: introduction users view your completed director movies in one of the following ways: • in a projector, which plays on your user’s computer as a stand-alone application. • in the macromedia shockwave player format, which plays in shockwave-enabled web browsers. Millions of web users alr...

  • Page 13

    Guide to instructional media 13 integrating with macromedia server technologies you can now choose to integrate director with macromedia server technologies, such as macromedia coldfusion mx 6.1 and macromedia flash communication server mx. For multi-user games, distance learning content, and other ...

  • Page 14

    14 chapter 1: introduction to access context-sensitive help, do one of the following: • if you are working in a window, display the options menu for that window and select help. • if you are working in a dialog box, click the help button. Director help opens and displays a topic that relates to the ...

  • Page 15

    Guide to instructional media 15 director scripting reference this manual is available in printable pdf format from the director documentation center at www.Macromedia.Com/go/director_docs . It provides a complete reference of the director application programming interfaces (apis), including both lin...

  • Page 16

    16 chapter 1: introduction.

  • Page 17: Chapter 2

    17 chapter 2 score, stage, and cast if you are new to macromedia director mx 2004, see the getting started topics in the director help panel to become familiar with the director workspace and features. (in macromedia director mx 2004, select help > director help to view the getting started topics.) ...

  • Page 18

    18 chapter 2: score, stage, and cast to change tool palette views: 1 if the tool palette is not already available, select window > tool palette. The default tool palette appears. 2 click on the tool palette view menu and select the view you want: classic, flashcomponent, or default. The tool palette...

  • Page 19

    Using multiple score windows 19 to create and set guide properties: 1 with the property inspector open, click the guides tab. The top half of the tab contains settings for guides. 2 click the guide color box to select a different color. 3 select the options you want to make the guides visible, lock ...

  • Page 20

    20 chapter 2: score, stage, and cast changing score settings to control the appearance of the score and the information that appears in numbered sprite channels, you set preferences for the score. By doing so, you can display a script preview and cast member information. To change score settings: 1 ...

  • Page 21

    Selecting and editing frames in the score 21 selecting and editing frames in the score you can select a range of frames in the score and then copy, delete, or paste all the contents of the selected frames. To move, copy, or delete all the contents of a range of frames: 1 double-click in the frame ch...

  • Page 22

    22 chapter 2: score, stage, and cast to add new frames: 1 select a frame in the score. 2 select insert > frames. 3 enter the number of frames to insert. The new frames appear to the right of the selected frame. Sprites in the frames you select are extended or tweened. For more information about twee...

  • Page 23

    Creating new casts 23 casts can be internal—stored inside the movie file and exclusive to that movie—or external— stored outside the movie file and available for sharing with other movies. When you create a new movie, an empty internal cast is created automatically, and when you open the cast window...

  • Page 24

    24 chapter 2: score, stage, and cast to create a new cast: 1 do one of the following: ■ select file > new > cast. ■ select modify > movie > casts to open the movie casts dialog box, and click the new button. ■ in the cast window, click the cast button and select new cast from the pop-up menu. (see “...

  • Page 25

    Creating cast members 25 to create a new cast member from the insert menu: 1 open the cast window for the cast member you are creating. To place a cast member in a specific position in the cast window, select the position in thumbnail view. For more information, see “using cast thumbnail view” on pa...

  • Page 26

    26 chapter 2: score, stage, and cast to create a cast member using the script window: 1 open the script window by selecting window > script. 2 click the new cast member button to create a script cast member. To create a cast member on the stage: 1 open the tool palette, if it is not already open, by...

  • Page 27

    Using the cast window 27 working with cast panel groups each cast panel and panel group has an options menu located in its upper right corner. The options menu contains items for grouping, closing, and renaming panels. To use a cast panel options menu: • click the options menu control in the upper r...

  • Page 28

    28 chapter 2: score, stage, and cast to rearrange the order of tabs within a cast panel group: 1 select a tab within the cast panel group. 2 select group [panel name] with from the panel group’s options menu, then choose the name of the cast panel group that contains the selected panel. The tab is m...

  • Page 29

    Using the cast window 29 using cast window controls the controls along the top of the cast window are the same in both the list and thumbnail views. You use the controls to change the cast that appears in the cast window, the cast member selection, or the name of a cast member. You can also use them...

  • Page 30

    30 chapter 2: score, stage, and cast to view cast member properties: 1 select a cast member. 2 do one of the following: ■ click the cast member properties button. ■ right-click (windows) or control-click (macintosh), and select cast member properties from the context menu. ■ select window > property...

  • Page 31

    Using cast list view 31 naming cast members to avoid problems in lingo or javascript syntax when referring to cast members, you should name them and then refer to them by name. Naming cast members doesn’t affect director performance. The name stays the same even if the cast member number changes. Av...

  • Page 32

    32 chapter 2: score, stage, and cast four additional columns are available in the cast window preferences dialog box. For more information, see “setting cast window preferences” on page 36 . The additional columns that you can display are described in the following table: resizing columns in cast li...

  • Page 33

    Using cast thumbnail view 33 using cast thumbnail view as the name suggests, the cast thumbnail view shows a very small (thumbnail) version of the cast member, along with an icon that represents the cast member media type, as shown in the following table: icon cast member type icon cast member type ...

  • Page 34

    34 chapter 2: score, stage, and cast to turn off or on the display of cast member icons in thumbnail view and change the cast window display: • select edit > preferences > cast. For more information, see “setting cast window preferences” on page 36 . Note: if you are using a macintosh os x operating...

  • Page 35

    Organizing cast members within the cast window 35 moving cast members within the cast window to move a cast member to a new position within the cast window, you can use thumbnail view to see the representation of the cast member’s position. Note: when you move a cast member to a new position, direct...

  • Page 36

    36 chapter 2: score, stage, and cast to sort the cast using the modify menu: 1 with the cast window active, select the cast members to sort or select edit > select all. 2 select modify > sort. 3 in the sort cast members dialog box, select one of the following sorting methods: usage in score places s...

  • Page 37

    Setting cast window preferences 37 3 to set the cast window to display in either list or thumbnail view, select the appropriate cast view option. 4 if you want your preferences to apply to all cast windows, select apply to all casts. 5 to select the columns that appear in cast list view, select the ...

  • Page 38

    38 chapter 2: score, stage, and cast changing cast properties you use the property inspector to change the name of a cast and to define how its cast members are loaded into memory. To change cast window properties: 1 with the cast window as the active window, open the property inspector and click th...

  • Page 39

    Viewing and setting cast member properties 39 viewing and setting cast member properties you can display and set properties for individual cast members, or for multiple cast members at once, even if the cast members are different types. In both cases, you use the property inspector. You can also set...

  • Page 40

    40 chapter 2: score, stage, and cast for information about specific cast member properties, see the following topics: • “using animated gifs” on page 101 ” • “embedding fonts in movies” on page 164 • “using flash content” on page 181 • “setting bitmap cast member properties” on page 128 • “setting v...

  • Page 41

    Finding cast members 41 to find cast members: 1 select edit > find > cast member. 2 in the find cast member dialog box, select a cast window to search from the cast pop-up menu. To search every cast in the movie, select all casts. 3 select a search option: ■ select name, and enter search text in the...

  • Page 42

    42 chapter 2: score, stage, and cast importing cast members importing lets you create cast members from external media. You can either import data into a director movie file or create a link to the external file and re-import the file each time the movie opens. Linked files let you display dynamic m...

  • Page 43

    Importing cast members 43 6 from the media pop-up menu at the bottom of the dialog box, select an option to specify how to treat imported media: standard import imports all selected files, storing them inside the movie file but not updating them when changes are made to the source material. If you s...

  • Page 44

    44 chapter 2: score, stage, and cast to import files with lingo or javascript syntax: • use the importfileinto method to import a file. Set the filename cast member property to assign a new file to a linked cast member. For more information about this property, see the scripting reference topics in ...

  • Page 45

    Importing cast members 45 • to retrieve media from the internet during playback, director requires that the projector include certain xtra extensions. To include these xtra extensions automatically, click add network in the movie xtras dialog box. Movies playing in web browsers do not require these ...

  • Page 46

    46 chapter 2: score, stage, and cast launching external editors you can specify external applications to edit many types of media. All the types of media for which you can define an external editor are listed in the editors preferences dialog box. After you set up an external editor for a particular...

  • Page 47

    Managing external casts 47 2 edit the cast member. If you change an image in the paint window and then edit the image with an external editor, changes made in the paint window, with the exception of registration points, are lost. Director warns you of this possibility. 3 save and close the file. Dir...

  • Page 48

    48 chapter 2: score, stage, and cast 4 click create. The cast is created, and a cast window for the cast appears in list view. For more information, see “using the cast window” on page 26 . 5 select file > save while the cast window is active, and save the cast in the desired directory. To link an e...

  • Page 49

    Setting xtra cast member properties 49 setting cast member properties using lingo or javascript syntax lingo or javascript syntax lets you control and edit cast members by setting their properties. Some properties are available for every type of cast member, and other properties are available only f...

  • Page 50

    50 chapter 2: score, stage, and cast to view or change xtra cast member properties: 1 select an xtra cast member. 2 open the property inspector, and click the member tab. The member tab displays the following information about the member: ■ the cast member name ■ the name of the cast that contains t...

  • Page 51: Chapter 3

    51 chapter 3 sprites a sprite is an object that controls when, where, and how cast members appear in a macromedia director mx 2004 movie. Multiple sprites can use the same cast member. You can also switch cast members assigned to a sprite as the movie plays. You use the stage to control where a spri...

  • Page 52

    52 chapter 3: sprites creating sprites you create a sprite by dragging a cast member to either the stage or the score: the sprite appears in both places. New sprites, by default, span 30 frames. To create a new sprite: 1 click to select the frame in the score where you want the sprite to begin. 2 fr...

  • Page 53

    Selecting sprites 53 selecting sprites to edit or move a sprite, you must select it. You can select sprites, frames within sprites, and groups of sprites in several ways. You use the arrow tool on the tool palette to select sprites before most operations. You can also select sprites with the rotate ...

  • Page 54

    54 chapter 3: sprites • to select a contiguous range of sprites either on the stage or in the score, select a sprite at one end of the range and then shift-click a sprite at the other end of the range. You can also drag to select all the sprites in an area. • to select discontiguous sprites, control...

  • Page 55

    Naming sprites 55 naming sprites you can assign a name to a sprite by using the property inspector and then view the sprite by name in the score and on the stage. Assigning a name lets you refer to the sprite by that name in lingo or javascript syntax and not just by the channel number that it occup...

  • Page 56

    56 chapter 3: sprites to view a sprite in the score by its name: 1 in the score, select the sprite labels pop-up menu. 2 select name. All the sprites in the score appear with their sprite name listed. To view a sprite on the stage by its name: • select a sprite on the stage. The sprite name appears ...

  • Page 57

    Creating sprite channel names 57 finding sprites you can search for and find sprites by name. When you have many sprites in a movie, searching for a sprite by name is easier and more efficient than searching by channel name or number. To find a sprite by name: 1 select edit > find > find sprite. The...

  • Page 58

    58 chapter 3: sprites to name a sprite channel: 1 double-click a channel in the score sprite channel column. A text box appears. 2 type a name for the channel and press enter. Layering sprites a sprite appears in front of other sprites on the stage according to its channel. Sprites in higher- number...

  • Page 59

    Displaying and editing sprite properties 59 displaying and editing sprite properties as you work with sprites in your movie, you’ll want to monitor and possibly modify sprite properties. Director offers several methods of accomplishing this by using one or more of the following: • the property inspe...

  • Page 60

    60 chapter 3: sprites note: to open a window in which you can edit the sprite’s cast member, you can double-click the thumbnail image. 3 edit any of the following sprite settings in the property inspector: lock changes the sprite to a locked sprite so you or other users can’t change it. For addition...

  • Page 61

    Displaying and editing sprite properties 61 to show or hide the sprite toolbar in the score: • while the score is active, select view > sprite toolbar. The sprite toolbar is displayed across the top of the score. Using the sprite overlay the sprite overlay displays important sprite properties direct...

  • Page 62

    62 chapter 3: sprites to change the opacity of the sprite overlay: • drag up or down the small thin line that appears on the right edge of the sprite overlay. . Displaying sprite labels in the score sprite labels appear in the score’s sprite bars and display key information about the sprite in relat...

  • Page 63

    Locking and unlocking sprites 63 behavior displays the behavior that is assigned to the sprite. Location displays the x and y coordinates of the sprite’s registration point. Ink displays the ink effect that is applied to each sprite. Blend displays the blend percentage. Extended displays any combina...

  • Page 64

    64 chapter 3: sprites to lock a sprite: in the stage or the score, select one or more sprites to lock, and do one of the following: • select modify > lock sprite. • on the sprite tab of the property inspector, click the padlock icon. • right-click (windows) or option-click (macintosh), and select lo...

  • Page 65

    Positioning sprites 65 the following diagram shows all the sprite coordinates you can specify. Director places the image of a cast member on the stage by specifying the location of its registration point. For many cast members, such as bitmap or vector shapes, the registration point is in the center...

  • Page 66

    66 chapter 3: sprites positioning sprites with the property inspector you can use the property inspector to specify the exact coordinates of a sprite. To set sprite coordinates in the property inspector: 1 with the property inspector open and in graphical view, select a sprite to reposition. 2 on th...

  • Page 67

    Positioning sprites 67 4 to add a guide, move the cursor over the new horizontal or vertical guide, and then drag the guide to the stage. Numbers in the guide tooltip indicate the distance, in pixels, the guide is located from the top or left edge of the stage. 5 to reposition a guide, move the poin...

  • Page 68

    68 chapter 3: sprites 3 select alignment buttons to modify the selected objects: ■ for align, select align left edge, align horizontal center, align right edge, align horizontal registration point, align top edge, align vertical center, align bottom edge, or align vertical registration point. ■ for ...

  • Page 69

    Positioning sprites 69 to determine whether two sprites overlap: • use the sprite...Intersects operator to determine whether a sprite’s bounding rectangle touches the bounding rectangle of a second sprite. Use the sprite...Within operator to determine whether a sprite is entirely within a second spr...

  • Page 70

    70 chapter 3: sprites changing the duration of a sprite on the stage by default, director assigns each new sprite a duration of 30 frames. You can change the duration of a sprite—that is, the amount of time the sprite appears in a movie—by adjusting its length, changing the number of frames in which...

  • Page 71

    Changing the appearance of sprites 71 to split an existing sprite: 1 in the score, click the frame within a sprite where you want the split to occur. The playhead moves to the selected frame. 2 select modify > split sprite. Director splits the sprite into two new ones. To join separate sprites into ...

  • Page 72

    72 chapter 3: sprites to resize a sprite by dragging its handles: 1 select the sprite. 2 on the stage, drag any of the sprite’s resize handles. Hold down shift while dragging to maintain the sprite’s proportions. To scale a sprite by pixels or by an exact percentage: 1 select the sprite you want to ...

  • Page 73

    Changing the appearance of sprites 73 director can rotate and skew bitmaps, text, vector shapes, macromedia flash content, quicktime videos, and animated gifs. Director rotates a sprite around its registration point, which is a marker that appears on a sprite when you select it with your mouse. By d...

  • Page 74

    74 chapter 3: sprites to rotate or skew a sprite with the property inspector: 1 select the sprite you want to rotate or skew and click the sprite tab in the property inspector (list view). 2 to rotate the selected sprite, display the rotation pop-up menu and enter the number of degrees in the rotati...

  • Page 75

    Changing the appearance of sprites 75 flipping sprites flipping a sprite creates a horizontally or vertically inverted image of the original sprite. To flip a sprite: 1 select a sprite. 2 do any of the following: ■ click the flip vertical or flip horizontal button on the sprite tab in the property i...

  • Page 76

    76 chapter 3: sprites to change the color of a sprite with lingo or javascript syntax, set the appropriate sprite property: • the color sprite property sets the sprite’s foreground color. The value is an rgb value. For more information about this property, see the scripting reference topics in the d...

  • Page 77

    Using sprite inks 77 using sprite inks you can change a sprite’s appearance on the stage by applying inks. Sprite inks change the display of a sprite’s colors. Inks are most useful to hide white bounding rectangles around images, but they can also create many compelling and useful color effects. Ink...

  • Page 78

    78 chapter 3: sprites black areas of a mask cast member make the sprite completely opaque in those areas, and white areas make it completely transparent (invisible). Colors between black and white are more or less transparent; darker colors are more opaque. When creating a bitmap mask for a sprite, ...

  • Page 79

    Using sprite inks 79 ink definitions the following definitions describe all available ink types. Copy displays all the original colors in a sprite. All colors, including white, are opaque unless the image contains alpha channel effects (transparency). Copy is the default ink and is useful for backgr...

  • Page 80

    80 chapter 3: sprites subtract subtracts the rgb color value of the foreground sprite’s color from the rgb value of the background sprite’s color to determine the new color. If the color value of the new color is less than 0, director adds 256 so the remaining value is between 0 and 255. Subtract pi...

  • Page 81

    Exchanging cast members 81 exchanging cast members the exchange cast members command changes the cast member associated with a particular sprite to the currently selected cast member; that is, it replaces the member reference for the selected sprite with the member reference of the selected cast mem...

  • Page 82

    82 chapter 3: sprites.

  • Page 83: Chapter 4

    83 chapter 4 animation animation is the appearance of an image changing over time. The most common types of animation in macromedia director mx 2004 involve moving a sprite on the stage (tweening animation) and using a series of cast members in the same sprite (frame-by-frame animation). • tweening ...

  • Page 84

    84 chapter 4: animation to open the sprite tweening dialog box: • select a sprite, then select modify > sprite > tweening. A keyframe usually indicates a change in sprite properties. Properties that can be tweened are position, size, rotation, skew, blend, and foreground and background color. Each k...

  • Page 85

    Accelerating and decelerating sprites 85 3 insert keyframes in any additional frames where you want the sprite’s animation path to change. 4 drag the red handle within the sprite to the place on the stage where you want the sprite’s path to end. The red handle represents the sprite’s location in the...

  • Page 86

    86 chapter 4: animation • the speed settings control how director moves a sprite between each keyframe. The sharp changes option is the default setting. Using this option, director calculates how to move the sprite between each pair of keyframes separately. If a sprite’s keyframes are separated by u...

  • Page 87

    Suggestions and shortcuts for tweening 87 5 to define the beginning property settings, click the sprite tab of the property inspector and do any of the following: ■ to make the sprite fade in or out, enter a blend setting in the property inspector (in list view). Enter 0 to make the sprite fade in o...

  • Page 88

    88 chapter 4: animation changing tweening settings to change tweening properties for sprites, you use the sprite tweening dialog box. You can turn tweening on and off for certain properties and control the curve of a tweening path and the way the speed changes as a sprite moves. For information abou...

  • Page 89

    Editing sprite frames 89 switching a sprite’s cast members to show different content while maintaining all other sprite properties, you exchange the cast member assigned to a sprite. This technique is useful when you have tweened a sprite and you decide to use a different cast member. When you excha...

  • Page 90

    90 chapter 4: animation when edit sprite frames is turned on for a certain sprite, clicking the sprite selects a single frame. Any change you make to a tweenable property, such as moving a sprite on the stage, defines a new keyframe. To use edit sprite frames, do one of the following: • select a spr...

  • Page 91

    Frame-by-frame animation 91 to animate a sprite with multiple cast members: 1 create a sprite by placing the first cast member in the animation on the stage in the appropriate frame. 2 change the length of the sprite as needed. Drag the start or end frame in the score, or enter a new start or end fr...

  • Page 92

    92 chapter 4: animation shortcuts for animating with multiple cast members the cast to time and space to time commands are both useful shortcuts for animating with multiple cast members. Using the cast to time command to move a series of cast members to the score as a single sprite, you use the cast...

  • Page 93

    Shortcuts for animating with multiple cast members 93 using the space to time command to move sprites from adjacent channels to a single sprite, you use the space to time command (modify > space to time). This method is convenient when you want to arrange several images on the stage in one frame and...

  • Page 94

    94 chapter 4: animation using film loops a film loop is an animated sequence that you can use like a single cast member. For example, to create an animation of a bird flying across the stage, you can create a film loop of the sequence of cast members that shows the bird flapping its wings. Instead o...

  • Page 95

    Setting film loop properties 95 director provides three other ways of incorporating a completed animation into a movie as a discrete element: you can export it as a digital video (quicktime or avi) or a dib file (bmp), save and import it as a linked director movie, or play it in a window in another ...

  • Page 96

    96 chapter 4: animation step-recording animation step recording is a process of animating one frame at time. You record the position of a sprite in a frame, step forward to the next frame, move the sprite to its new position, step forward to the next frame, and so on until you have completed the ani...

  • Page 97

    Animating sprites with lingo or javascript syntax 97 to use real-time recording: 1 select one or more sprites on the stage or in the score. Recording begins at the playhead. It is best to select a sprite in a channel that contains no other sprites later in the movie. To record in a specific range of...

  • Page 98

    98 chapter 4: animation.

  • Page 99: Chapter 5

    99 chapter 5 bitmaps bitmaps and vector shapes are the two main types of graphics used with macromedia director mx 2004. A bitmap defines an image as a grid of colored pixels, and it stores the color for each pixel in the image. A vector shape is a mathematical description of a geometric form that i...

  • Page 100

    100 chapter 5: bitmaps a bitmap typically requires more ram and disk space than a comparable vector shape. If not compressed, bitmaps take longer than vector shapes to download from the internet. Fortunately, director offers compression control to reduce the size of bitmaps in movies that you packag...

  • Page 101

    Using animated gifs 101 using animated gifs you can import an animated gif into director with file > import, similar to the way in which you import any other bitmap cast member. The only difference is that when the select format dialog box appears, you select animated gif. Director supports both the...

  • Page 102

    102 chapter 5: bitmaps using the paint window the paint window has a complete set of paint tools and inks for creating and changing bitmap cast members for movies. Anything you draw in the paint window becomes a cast member. When you make a change to a cast member in the paint window, the image in t...

  • Page 103

    Using the paint window 103 to erase, do one of the following: • click and drag the eraser tool to erase pixels. • double-click the eraser tool to erase the cast member. To move the view of the paint window, do one of the following: • click and drag the hand tool to move the visible portion of the im...

  • Page 104

    104 chapter 5: bitmaps to brush strokes of the foreground color: • click the brush tool, and drag it in the paint window. To constrain the stroke to horizontal or vertical, shift-click and drag. To select a new brush type: • click the brush tool, and hold down the mouse button to select a new brush ...

  • Page 105

    Using the paint window 105 to select a pattern for the foreground color, do one of the following: • to change the pattern palette, select pattern settings at the bottom of the patterns pop-up menu. • to define a tile—a pattern that is based on a rectangular section of an existing cast member— select...

  • Page 106

    106 chapter 5: bitmaps using the lasso tool you use the lasso tool to select irregular areas or polygons. After you select artwork, it can be dragged, cut, copied, cleared, or modified with the effects on the paint toolbar. The lasso tool selects only those pixels of a color that are different from ...

  • Page 107

    Using the paint window 107 to change marquee settings: • click the marquee tool, hold down the mouse button, and select from the following options: shrink causes the rectangle to shrink around the selected artwork. No shrink lets you select everything within the marquee. Lasso tightens the marquee a...

  • Page 108

    108 chapter 5: bitmaps to change brush settings: 1 click the brush tool, and hold down the mouse button. 2 select the menu item for which you want to define settings. 3 open the menu again, and select settings from the brush pop-up menu. Enter values for the options in the brush settings dialog box....

  • Page 109

    Flipping, rotating, and applying effects to bitmaps 109 • control-click (windows) or command-click (macintosh) the image to zoom in on a particular place. To return to normal view, do one of the following: • click the normal-sized image in the upper right corner. • select view > zoom > 100%. Changin...

  • Page 110

    110 chapter 5: bitmaps note: to repeat any of these effects after using them, press control+y (windows) or command+y (macintosh). To flip, rotate, skew, or apply effects to part of a bitmap: 1 select part of a bitmap in the paint window with the marquee tool. 2 use any of the following effects: ■ to...

  • Page 111

    Using auto distort 111 to apply color effects to a selected area: 1 select an area within a bitmap cast member by using either the marquee or the lasso tool. 2 use any of the following effects: ■ to soften the edges of the selected artwork, click the smooth button. This effect works only with 8-bit ...

  • Page 112

    112 chapter 5: bitmaps changing registration points a registration point is a marker that appears on a sprite when you select it with your mouse. (registration points don’t appear on unselected sprites or when a movie is playing.) registration points provide a fixed reference point within an image, ...

  • Page 113

    Changing size, color depth, and color palette for bitmaps 113 3 click a location in the paint window to set the registration point. You can also drag the dotted lines around the window to reposition the registration point. Note: to reset the default registration point at the center of the cast membe...

  • Page 114

    114 chapter 5: bitmaps 5 to change the palette, select a palette from the palette pop-up menu and select one of the following remapping options: remap colors replaces the original colors in the graphic with the most similar solid colors in the new palette. This is the preferred option in most cases....

  • Page 115

    Controlling bitmap images with lingo or javascript syntax 115 to change the image assigned to a bitmap cast member: • set the picture cast member property. For more information about this property, see the scripting reference topics in the director help panel. To specify the background or foreground...

  • Page 116

    116 chapter 5: bitmaps the following statement draws a line on the previously created 640 x 480 image object myimage , running from 20 pixels inside the upper left corner to 20 pixels inside the lower right corner, and colors it blue: myimage.Draw(20, 20, 620, 460, rgb(0, 0, 255)) to draw a rectangl...

  • Page 117

    Using gradients 117 using gradients director can create gradients in the paint window. You can use gradients with the brush tool, the bucket tool, the text tool, or any of the filled shape tools. Typically, a gradient consists of a foreground color at one side (or the center) of an image and another...

  • Page 118

    118 chapter 5: bitmaps to edit gradient settings: 1 select gradient settings from the gradient colors pop-up menu. 2 to determine whether the gradient is created with the pattern you select with the patterns pop- up menu in the paint window or with a dithered pattern, select a type option, as descri...

  • Page 119

    Using gradients 119 left to right puts the foreground color on the left and the destination color on the right. Right to left puts the foreground color on the right and the destination color on the left. Directional lets you determine the direction of the gradient. You set the direction of the gradi...

  • Page 120

    120 chapter 5: bitmaps using patterns you can select among three sets of patterns that are included with director or create custom patterns. The patterns you change or edit in the paint window don’t affect the patterns that are available for shapes. To use a pattern: 1 select the brush tool, the buc...

  • Page 121

    Using paint window inks 121 to create a custom tile: 1 create a bitmap cast member to use as a tile, and display it in the paint window. 2 click the pattern box in the paint window, and select tile setting from the bottom of the patterns pop-up menu. 3 click an existing tile position to edit. The ex...

  • Page 122

    122 chapter 5: bitmaps normal is the default ink. It is opaque and maintains the color of the current foreground color and pattern. Transparent ink makes the background color of patterns transparent so artwork drawn previously in the current cast member can be seen through the pattern. Reverse ink m...

  • Page 123

    Using bitmap filters 123 darken makes colors darker. The more times you click with the brush tool, the darker the area becomes. The colors of the foreground, background, and destination inks have no effect on darken. Darken creates an effect that is the same as reducing a color’s brightness with the...

  • Page 124

    124 chapter 5: bitmaps to install a filter: • place the filter in the xtras folder in the director application folder. For more information about installing xtra extensions, see the getting started topics in the director help panel. To apply a filter: 1 open the cast member in the paint window, or s...

  • Page 125

    Using onion skinning 125 5 enter the number of new cast members you want to create. The text box is not available if you selected a range of cast members. 6 click filter to begin the filtering. A message appears to show the progress. Some filters are complex and require extra time for computing. Aut...

  • Page 126

    126 chapter 5: bitmaps to define the number of preceding or following cast members to display: 1 open the paint window, and select view > onion skin. The onion skin toolbar appears. 2 if necessary, click the toggle onion skinning button on the onion skin toolbar to activate onion skinning. 3 specify...

  • Page 127

    About the paste as pict option 127 to use a series of images as a background while painting a series of foreground images: 1 in the cast window, arrange the series of cast members you want to use as your background in consecutive order. Cast members in the foreground and the background series must b...

  • Page 128

    128 chapter 5: bitmaps setting bitmap cast member properties to view important information about cast members, change a cast member’s name, select alpha settings, or turn on highlighting and dithering, you use bitmap cast member properties. To view or change bitmap cast member properties: 1 select a...

  • Page 129

    Compressing bitmaps 129 setting paint window preferences you can use paint window preferences to modify the settings of several tools and drawing methods in the paint window. To change paint window preferences: 1 select edit > preferences > paint. Note: if you are using a macintosh os x operating sy...

  • Page 130

    130 chapter 5: bitmaps in addition to director standard compression, you can use jpeg compression and specify a range of image quality. If you have fireworks installed, you can use the optimize in fireworks button to start fireworks and then dynamically apply compression settings while viewing how y...

  • Page 131

    Working with macromedia fireworks 131 working with macromedia fireworks you can combine the power of macromedia fireworks and director. Fireworks lets you export graphics and interactive content into director. The export process preserves the behaviors and slices of the graphic. You can safely expor...

  • Page 132

    132 chapter 5: bitmaps importing fireworks files into director in director, you can import flattened images that you have exported from fireworks, such as jpegs, gifs, and 32-bit pngs. You can also import fireworks layers, slices, and interactive elements by inserting fireworks html. To import a fla...

  • Page 133

    Working with macromedia fireworks 133 editing director cast members in fireworks using launch-and-edit integration, you can make changes to director cast members by starting fireworks and editing them from inside director. You can also start fireworks from inside director to optimize cast members. T...

  • Page 134

    134 chapter 5: bitmaps.

  • Page 135: Chapter 6

    135 chapter 6 vector shapes vector shapes and bitmaps are the two main types of graphics used with macromedia director mx 2004. A vector shape is a mathematical description of a geometric form that includes the thickness of the line, the fill color, and additional features of the line that can be ex...

  • Page 136

    136 chapter 6: vector shapes • the first vertex in a curve is green. • the last vertex in a curve is red. • all other vertices are blue. • unselected vertices are solid. • selected vertices are unfilled. To open the vector shape window: • select window > vector shape. Zooming in and out in the vecto...

  • Page 137

    Drawing vector shapes 137 to create a vector shape using the pen tool: 1 in the vector shape window, click the new cast member button. 2 click the pen tool and begin to draw: ■ to create a corner point, click once. ■ to create a curve point, click and drag. Dragging creates control handles that defi...

  • Page 138

    138 chapter 6: vector shapes choosing fill and line settings for vector shapes you can use either controls in the vector shape window or lingo or javascript syntax to choose a vector shape’s fill color, line width and color, and background color. The background is the area outside of a vector shape ...

  • Page 139

    Editing vector shapes 139 to specify a vector shape’s fill in script: • set the fillcolor , fillmode , filloffset , and fillscale cast member properties. For more information about these properties, see the scripting reference topics in the director help panel. Editing vector shapes to edit vector s...

  • Page 140

    140 chapter 6: vector shapes to join two curves: 1 select a vertex in each curve. If you select two endpoint vertices, you join them. If you select points in the middle of the curve, you join the start of the second curve to the end of the first curve. 2 select modify > join curves. To split two cur...

  • Page 141

    Defining gradients for vector shapes 141 defining gradients for vector shapes you can use controls in the vector shape window or lingo or javascript syntax to specify the type of gradient, how it is placed within a shape, and how many times it cycles within the shape. A gradient for a vector shape s...

  • Page 142

    142 chapter 6: vector shapes controlling vector shapes with lingo or javascript syntax you can use script to modify a vector shape by setting properties and using methods related to the shape’s vertices. For more information about the following properties, expressions, and methods, see the scripting...

  • Page 143

    Using shapes 143 9 to specify how vector shapes are scaled on the stage, select an option from the scale mode pop-up menu. Show all maintains the vector shape’s aspect ratio and, if necessary, fills in any gap along the horizontal or vertical dimension using the vector shape’s background color. No b...

  • Page 144

    144 chapter 6: vector shapes setting shape cast member properties you can use cast member properties to view and change settings for selected shape cast members. You can change the type of shape and choose a new fill color or pattern. You can also use lingo or javascript syntax to control shape cast...

  • Page 145: Chapter 7

    145 chapter 7 color, tempo, and transitions several behind-the-scenes functions in macromedia director mx 2004 are important to the appearance and performance of a movie. To control the way director manages colors, it’s important to understand the difference between rgb and index color, and how to a...

  • Page 146

    146 chapter 7: color, tempo, and transitions specifying palette index and rgb color director can use either palette index values or rgb values to specify colors. Rgb values are much more reliable and accurate for specifying colors than palette index values. Rgb is the system that most web pages use....

  • Page 147

    Controlling color 147 changing the color depth of a movie when you save a director movie, it is set to the same color depth as the system on which you are authoring. You can use lingo or javascript syntax to reset the system color depth to match the color depth of a movie. For more information, see ...

  • Page 148

    148 chapter 7: color, tempo, and transitions to open the color menu: 1 do one of the following: ■ select a sprite and display the sprite tab of the property inspector. ■ select window > tool palette. 2 click and hold the mouse button while pointing at the foreground color and background color button...

  • Page 149

    Controlling color 149 to change the color palette displayed on the color menu: 1 select window > color palettes or double-click the mouse button on the foreground color and background color buttons in the tool palette. 2 select a color palette from the palette pop-up menu. Changing color palettes du...

  • Page 150

    150 chapter 7: color, tempo, and transitions to specify a palette: 1 in the score, do one of the following: ■ double-click the cell in the palette channel where you want the new palette setting to appear. ■ right-click (windows) or control-click (macintosh) the cell in the effects channel where you ...

  • Page 151

    Controlling color 151 using the color palettes window use the color palettes window to change and rearrange color palettes and to determine which colors in a palette are used in an image. This section explains basic features of the color palettes window. If you add new palettes to your movie from ot...

  • Page 152

    152 chapter 7: color, tempo, and transitions 7 select modify > transform bitmap and select the desired options. Note: be sure to select remap colors, not dither. 8 click transform to remap all the cast members to the new palette. To select one or more colors: 1 click a color in the color palettes wi...

  • Page 153

    Controlling color 153 to select colors in the palette used by the current cast member: 1 in the cast window, select the cast member. 2 select window > color palettes. 3 click the select used colors button in the color palettes window. 4 in the select colors used in bitmap dialog box, click select. T...

  • Page 154

    154 chapter 7: color, tempo, and transitions to edit selected colors in the color palettes window: 1 select window > color palettes. 2 select the palette you want to change from the palette pop-up menu. 3 select a color within the palette to change. If you attempt to change one of the default palett...

  • Page 155

    Setting palette cast member properties 155 to solve color palette problems, follow these guidelines: • to avoid color problems in movies for the web, map all 8-bit bitmaps in your movie to the web216 color palette that is built in to director. This is essentially the same palette used by netscape na...

  • Page 156

    156 chapter 7: color, tempo, and transitions 3 from the palette pop-up menu, select the palette that you want to use to create a new palette cast member. 4 double-click any color within the palette. Director makes a copy of the palette and prompts you to enter a name. 5 in the create palette dialog ...

  • Page 157

    About tempo 157 about tempo tempo is the number of frames per second that director tries to play. You can control tempo by using the score tempo channel or the puppettempo method. Director tempo settings control the maximum speed at which the playhead moves from frame to frame. The tempo doesn’t aff...

  • Page 158

    158 chapter 7: color, tempo, and transitions to specify a tempo setting: 1 in the score, do one of the following: ■ double-click the cell in the tempo channel where you want the new tempo setting to appear. ■ right-click (windows) or control-click (macintosh) the cell in the effects channel where yo...

  • Page 159

    About tempo 159 comparing actual speed with tempos it’s good practice to test the performance of your movie on a system that is similar to that of your users. Make sure the movie plays well on the slowest systems likely to be used. The tempo you’ve set and the actual speed of a movie both appear in ...

  • Page 160

    160 chapter 7: color, tempo, and transitions using transitions transitions create brief animations that play between frames to create a smooth flow as sprites move, appear, or disappear or as the entire stage changes. Director provides dozens of transitions built into the application, and many third...

  • Page 161

    Using transitions 161 tips for using transitions here are some points to remember when working with transitions: • to play a sound while a transition occurs, place the sound in the frame immediately before the transition. • the dissolve pixels, dissolve pixels fast, or dissolve patterns transitions ...

  • Page 162

    162 chapter 7: color, tempo, and transitions setting transition cast member properties you use the property inspector to set values for the transition cast member. To view or change transition cast member properties: 1 select a transition cast member. 2 to display the property inspector, select modi...

  • Page 163: Chapter 8

    163 chapter 8 text macromedia director mx 2004 creates text that is editable, anti-aliased, and compact for fast downloading of outline fonts on both the macintosh and windows platforms. Combine these features with any of the animation capabilities of director, such as rotation, and you can create w...

  • Page 164

    164 chapter 8: text embedding fonts in movies before creating text or field cast members, it’s good practice to embed the fonts you want to use in the movie. Embedding fonts makes director store all font information in the movie file so that a font displays properly even if it is not installed in a ...

  • Page 165

    Creating text cast members 165 to embed a font in a movie with lingo or javascript syntax: • use the recordfont method. For more information about this method, see the scripting reference topics in the director help panel. Creating text cast members you can create text within director or import text...

  • Page 166

    166 chapter 8: text when you import text from an html document, director recognizes many standard tags and parameters, including tables, and approximates the formatting. Director does not recognize embedded objects other than tables, and it does not support nested tables. It also does not recognize ...

  • Page 167

    Editing and formatting text 167 3 use the text inspector (window > text inspector) to reformat the text. You can also use the modify > font and modify > paragraph commands to reformat selected text. When you make a change, director updates all sprites that display the text cast member. Note: if you’...

  • Page 168

    168 chapter 8: text to make formatting changes to a paragraph: 1 double-click the text sprite in the score or the text cast member in the cast window to open the text window. 2 if the ruler is not visible, select view > rulers. To change the unit of measure on the text ruler, select edit > preferenc...

  • Page 169

    Editing and formatting text 169 formatting entire cast members director can apply formatting changes to entire cast members. This process is much faster than manually opening each cast member and applying changes. Any change you apply to a cast member affects all the text within the cast member. To ...

  • Page 170

    170 chapter 8: text about anti-aliased text anti-aliased text is text that uses color variations to make its jagged angles and curves look smoother. Director activates anti-aliasing by default. You can change this setting on the text tab of the property inspector (for more information, see “setting ...

  • Page 171

    Creating a hypertext link 171 6 to specify the cast members in which to search, select one of the following search options: cast member [cast member name] limits the search to the current cast member. Cast [cast name] limits the search to cast members in the current cast. All casts extends the searc...

  • Page 172

    172 chapter 8: text working with fields working with field cast members is similar to working with text. As with text cast members, you edit fields on the stage or in a window, and apply formatting with the text inspector. Not all text formatting options are available for fields: you can’t apply spa...

  • Page 173

    Mapping fonts between platforms for field cast members 173 to make a text sprite editable in a range of frames: 1 select a range of frames within a sprite. You can select an entire sprite, or shift-alt-click (windows) or shift-option-click (macintosh) to select frames within a sprite. 2 click the pr...

  • Page 174

    174 chapter 8: text fontmap.Txt also determines the scaling of fonts and how special characters such as bullets and symbols are translated between platforms. Again, the default settings are correct for nearly all applications, but you can edit the settings if necessary you can also load and save fon...

  • Page 175

    Setting text or field cast member properties 175 6 to specify how director removes the cast member from memory if memory is low, select an option from the unload pop-up menu. For more information, see “controlling cast member unloading” on page 47 . 7 to change the text of the cast member, click edi...

  • Page 176

    176 chapter 8: text 12 to control how director anti-aliases text for a text cast member, select one of the following anti-alias options: all text anti-aliases all the text in the text block. Larger than anti-aliases only text that is larger than the point size entered in the points text box. None tu...

  • Page 177

    Formatting chunks of text with lingo or javascript syntax 177 formatting text with lingo or javascript syntax lingo or javascript syntax can format text in an entire cast member or any specific chunk of text. Use the following properties: • to select or identify a chunk of text in a field cast membe...

  • Page 178

    178 chapter 8: text formatting text or field cast members with lingo or javascript syntax in addition to formatting text in any chunk expression, lingo or javascript syntax can specify anti-aliasing and kerning for an entire text cast member and control the appearance of the text’s bounding rectangl...

  • Page 179

    Checking for specific text with lingo or javascript syntax 179 controlling scrolling text with lingo or javascript syntax you can script in lingo or javascript syntax to scroll text and determine the location of specific text within the text box for text and field cast members. For example, this sta...

  • Page 180

    180 chapter 8: text modifying strings with lingo or javascript syntax as time passes or other conditions change, you might want to update and change text. For example, you might want to frequently update a text sprite that displays the user’s name or a description of a musical selection that the use...

  • Page 181: Chapter 9

    181 chapter 9 using flash, flash components, and other interactive media types to add complex media and new capabilities to your macromedia director mx 2004 movie, you can use macromedia flash content (mx or later), flash components, other director movies, and activex controls. Each of these multime...

  • Page 182

    182 chapter 9: using flash, flash components, and other interactive media types in flash, you can create cross-platform windows and macintosh movies and then play or manipulate them in director. You can create flash content that communicates with your director movie by sending events that director s...

  • Page 183

    Adding a flash content cast member 183 4 select playback options to control how a flash content sprite plays in a director projector, in shockwave content, and while you are authoring in director: image displays the image of the flash content when it plays. When image is deselected, the flash movie ...

  • Page 184

    184 chapter 9: using flash, flash components, and other interactive media types about using flash content in a director movie once you have added flash content to the director cast, using it in your movie is as simple as dragging it to the stage and positioning it where you want it. You can then use...

  • Page 185

    Controlling flash content appearance with lingo or javascript syntax 185 to add flash to the list of external editors: 1 select edit > preferences > editors. Note: if you are using a macintosh os x operating system, select the director menu, instead of the edit menu, to access preferences. 2 select ...

  • Page 186

    186 chapter 9: using flash, flash components, and other interactive media types flipping, rotating, and skewing flash sprites lingo or javascript syntax can flip, rotate, and skew flash sprites as the movie plays. For more information, see the scripting reference topics in the director help panel. •...

  • Page 187

    Streaming flash content with lingo or javascript syntax 187 controlling the flash content bounding rectangle and registration points you can use lingo or javascript syntax to control the flash content bounding rectangle and to flash content registration points. For more information, see the scriptin...

  • Page 188

    188 chapter 9: using flash, flash components, and other interactive media types • to determine how much of flash content is currently streamed, test the percentstreamed property or check the streamsize method. • to set when director attempts to stream part of flash content, set the streammode proper...

  • Page 189

    Using lingo or javascript syntax to set and test flash variables 189 controlling flash content interactivity with lingo or javascript syntax lingo or javascript syntax can control whether flash content remains interactive. For more information, see the scripting reference topics in the director help...

  • Page 190

    190 chapter 9: using flash, flash components, and other interactive media types you can also use the following two sprite methods to access actionscript variables in flash sprites: getvariable() and setvariable (). For more information, see the scripting reference topics in the director help panel. ...

  • Page 191

    Sending messages from flash content using geturl 191 to handle a message string passed by flash content: 1 specify the message string in the flash content, as described above. For example, in flash, you could specify the following string as the url parameter of the geturl function: hello world in fl...

  • Page 192

    192 chapter 9: using flash, flash components, and other interactive media types in flash, the actionscript would look as follows: geturl("event:alertmessagereceived"); when director receives the geturl message from the flash sprite, the director movie immediately executes the script statement. Sendi...

  • Page 193

    Using flash objects in script 193 sending xml data from flash to director you can send xml data from a flash sprite or object to a script. To send xml data from a flash sprite or a global flash object to a script: 1 on the flash side, use the xmlobject . Send actionscript method. The xmlobject . Sen...

  • Page 194

    194 chapter 9: using flash, flash components, and other interactive media types the flash asset commonplayer feature gives you the ability to load multiple flash sprites into one instance of the flash player; this provides better flash playback performance in director objects that have a great deal ...

  • Page 195

    Using the flash local connection object 195 the callback handler could look like the following: on dironstatushandler (me, ainfoobject) if (ainfoobject[#level] = "error") then member("chat input").Text = "error sending last message." end if end using the flash local connection object flash includes ...

  • Page 196

    196 chapter 9: using flash, flash components, and other interactive media types setting up callbacks the next step is to set up callback handlers with the setcallback() method. You should set up a callback for each event you expect the object to generate. Local connection objects generate onstatus a...

  • Page 197

    Using the flash local connection object 197 the onstatus event is generated each time the local connection object sends an outgoing message. The myonstatus handler might look like this: on myonstatus (me, ainfoobject) if (ainfoobject[#level] = "error") then member("chat input").Text = "error sending...

  • Page 198

    198 chapter 9: using flash, flash components, and other interactive media types sending messages and closing the connection in order to complete your script, you must finish the beginsprite handler and write handlers for sending messages from the object and closing the connection when you are finish...

  • Page 199

    Using flash communication server mx 2004 199 to create a netconnection object: • use the newobject() method. Mynetconobject = sprite(1).Newobject("netconnection") to create a netstream object: • use the newobject() method and include the netconnection object as a parameter: mystream = sprite(1).Newo...

  • Page 200

    200 chapter 9: using flash, flash components, and other interactive media types to play a video stream through the video clip object: • use the attachvideo() method with the reference to the video clip. Videoref.Attachvideo(source) for detailed examples of how to use flash communication server in di...

  • Page 201

    Playback performance tips for flash content 201 4 click ok. 5 save your movie. Your publish settings are saved with the movie. Once you have disabled the shockwave context menu, you can attach a mouseup handler to your flash sprite that tests for the rightmousedown property or the controldown proper...

  • Page 202

    202 chapter 9: using flash, flash components, and other interactive media types • use lock-step or fixed playback mode to adjust the flash content frame rate. Lock-step gives the best performance, because playback of the flash content is synchronized to the director movie frame for frame. • set the ...

  • Page 203

    Setting linked director movie properties 203 to place a director movie cast member in the current movie: 1 do one of the following: ■ for an internal movie, drag the film loop cast member to the stage or score. ■ for a linked external movie, drag the movie cast member to the stage or score. 2 extend...

  • Page 204

    204 chapter 9: using flash, flash components, and other interactive media types 9 to determine how the linked movie plays back, set the following options play sound enables the sound portion of the linked movie. Turn this option off to mute sounds. Loop replays the linked movie continuously from the...

  • Page 205

    Using activex controls 205 4 set the values for each property in the activex control and then click ok. The activex control now appears in the cast. 5 drag the activex control from the cast to the stage. Once the activex control appears on the stage, it can be repositioned and resized just like any ...

  • Page 206

    206 chapter 9: using flash, flash components, and other interactive media types when you insert an activex control in a director movie, you can view the methods exposed by the control by clicking the methods tab of the control properties dialog box for the activex control. The dialog box displays ea...

  • Page 207

    Using flash components 207 using flash components macromedia flash mx 2004 components are bundled movie clips with actionscript programming interfaces. Director comes with a set of user interface components, including list boxes, radio buttons, check boxes, a scroll pane, and more. You can also add ...

  • Page 208

    208 chapter 9: using flash, flash components, and other interactive media types 3 drag and drop the component you want to a cast window slot, the score, or directly to the stage. Director mx 2004 includes the following flash components: button component creates a button that can be customized to inc...

  • Page 209

    Using flash components 209 setting flash component parameters each component has unique parameters that you can set to change its appearance and behavior. A parameter is a property or method that appears in the property inspector. The most commonly used properties and methods appear as authoring par...

  • Page 210

    210 chapter 9: using flash, flash components, and other interactive media types button component the button component is a resizable rectangular user interface button. You can add a custom icon to a button. You can also change the behavior of a button from push to toggle. A toggle button stays press...

  • Page 211

    Checkbox component 211 property summary for the button class event summary for the button class checkbox component a check box is a fundamental part of any form or web application. You can use check boxes wherever you need to gather a set of true or false values that aren’t mutually exclusive. For e...

  • Page 212

    212 chapter 9: using flash, flash components, and other interactive media types a checkbox component supports the following halo styles: property summary for the checkbox class event summary for the checkbox class datechooser component the datechooser component is a calendar that allows users to sel...

  • Page 213

    Datechooser component 213 datachooser parameters the following are authoring parameters that you can set for each datachooser component instance in the property inspector. Monthnames sets the month names that are displayed in the heading row of the calendar. The value is an array and the default val...

  • Page 214

    214 chapter 9: using flash, flash components, and other interactive media types property summary for the datechooser class event summary for the datechooser class label component a label component is a single line of text. You can specify that a label be formatted with html. You can also control ali...

  • Page 215

    Label component 215 autosize indicates how the label sizes and aligns to fit the text. The default value is none. The parameter can be any of the following four values: • none—the label doesn’t resize or align to fit the text. • left—the right and bottom sides of the label resize to fit the text. Th...

  • Page 216

    216 chapter 9: using flash, flash components, and other interactive media types list component the list component is a scrollable single- or multiple-selection list box. A list can also display graphics, including other components. The list component uses a zero-based index, where the item with inde...

  • Page 217

    List component 217 a list component uses the following halo styles: method summary for the list class style description alternatingrowcolors specifies colors for rows in an alternating pattern. The value can be an array of two or more colors, for example, 0xff00ff, 0xcc6699, and 0x996699. Background...

  • Page 218

    218 chapter 9: using flash, flash components, and other interactive media types property summary for the list class numericstepper component the numericstepper component allows a user to step through an ordered set of numbers. The component consists of a number displayed beside small up and down arr...

  • Page 219

    Numericstepper component 219 using the numericstepper component the numericstepper can be used anywhere you want a user to select a numeric value. For example, you could use a numericstepper component in a form to allow a user to set their credit card expiration date. In another example, you could u...

  • Page 220

    220 chapter 9: using flash, flash components, and other interactive media types property summary for the numericstepper class event summary for the numericstepper class radiobutton component a radio button is a fundamental part of any form or web application. You can use radio buttons wherever you w...

  • Page 221

    Radiobutton component 221 customizing the radiobutton component you can transform a radiobutton component horizontally and vertically both while authoring and at runtime. The bounding box of a radiobutton component is invisible and also designates the hit area for the component. If you increase the ...

  • Page 222

    222 chapter 9: using flash, flash components, and other interactive media types event summary for the radiobutton class scrollpane component the scroll pane component displays movie clips, jpeg files, and swf files in a scrollable area. You can enable scroll bars to display images in a limited area....

  • Page 223

    Scrollpane component 223 method summary for the scrollpane class property summary for the scrollpane class event summary for the scrollpane class method description scrollpane.Getbytesloaded() returns the number of bytes of content loaded. Scrollpane.Getbytestotal() returns the total number of conte...

  • Page 224

    224 chapter 9: using flash, flash components, and other interactive media types textarea component you can use a textarea component wherever you need a multiline text field. If you need a single- line text field, use the “textinput component” on page 225 . For example, you could use a textarea compo...

  • Page 225

    Textinput component 225 property summary for the textarea class event summary for the textarea class textinput component the textinput is a single-line component that wraps the native actionscript textfield object. You can use styles to customize the textinput component; when an instance is disabled...

  • Page 226

    226 chapter 9: using flash, flash components, and other interactive media types textinput component parameters the following are authoring parameters that you can set for each textinput component instance in the property inspector or in the component inspector panel: text specified the contents of t...

  • Page 227

    Tree component 227 event summary for the textinput class tree component the tree component allows a user to view hierarchical data. The tree appears within a box like the list component, but each item in a tree is called a node and can be either a leaf or a branch. By default, a leaf is represented ...

  • Page 228

    228 chapter 9: using flash, flash components, and other interactive media types the tree component can be used to represent hierarchical data such as e-mail client folders, file browser panes, or category browsing systems for inventory. Most often, the data for a tree is retrieved from a server in t...

  • Page 229

    Tree component 229 when a tree displays a node it uses the label attribute of the node by default as the text label. If any other attributes exist, they become additional properties of the node’s attributes within the tree. The actual root node is interpreted as the tree component itself. This means...

  • Page 230

    230 chapter 9: using flash, flash components, and other interactive media types property summary for the tree class event summary for the tree class tree.Seticon() specifies whether a node is open or closed. Tree.Setisopen() specifies a symbol to be used as an icon for a node. Property description a...

  • Page 231: Chapter 10

    231 chapter 10 sound and synchronization you can give your movie added appeal by including a sound track, a voice-over, ambient noises, or other sounds. With macromedia director mx 2004, you can control when sounds start and stop, how long they last, their quality and volume, and several other effec...

  • Page 232

    232 chapter 10: sound and synchronization director does not store sound data in a linked sound cast member. Instead, it keeps a reference to a sound file’s location and imports the sound data each time the sound begins playing. Because the sound is never entirely loaded into ram, the movie uses memo...

  • Page 233

    Controlling sound in the score 233 5 click the member tab in the property inspector. The following noneditable settings appear: ■ the cast member size in kilobytes ■ the cast member creation and edit dates ■ the name of the last person who modified the cast member 6 to view or edit the cast member n...

  • Page 234

    234 chapter 10: sound and synchronization 3 extend the sound through as many frames as necessary. New sounds are assigned the same number of frames as set for sprites in the sprite preferences dialog box. You might need to adjust the number of frames to make the sound play completely or change a tem...

  • Page 235

    Playing sounds with lingo or javascript syntax 235 playing sounds with lingo or javascript syntax lingo or javascript syntax lets you play and control sounds regardless of the settings in the score. You can use these scripts to play sounds, turn them on and off, and play external sounds that aren’t ...

  • Page 236

    236 chapter 10: sound and synchronization after queuing sounds, you can still control whether the queue is obeyed. You can select to interrupt loops with the breakloop() method or to pause playback with the pause() method. The playnext() method lets you skip immediately to the next sound in the queu...

  • Page 237

    Compressing internal sounds with shockwave audio 237 about shockwave audio shockwave audio is a technology that makes sounds smaller and plays them faster from disk or over the internet. Shockwave audio can compress the size of sounds by a ratio of up to 176:1 and is streamable, which means director...

  • Page 238

    238 chapter 10: sound and synchronization when you distribute a movie that contains sounds compressed with shockwave audio, the swa decompression xtra is already included in the macromedia shockwave player. If you compress sounds in shockwave format in a projector, you must provide the swa decompres...

  • Page 239

    Playing shockwave audio, windows media audio, and mp3 audio with lingo or javascript syntax 239 4 drag the shockwave audio cast member to a sprite channel (not one of the sound channels) to create a sprite. Extend the sprite through all frames in which the sound should play, or use the tempo channel...

  • Page 240

    240 chapter 10: sound and synchronization synchronizing media to pause the playhead until a specified cue point in a sound or digital video is reached, you can use the wait for cue point option in the tempo dialog box. You can also use this method to wait for the end of the sound or digital video, e...

  • Page 241

    Accessibility 241 synchronizing sound with lingo or javascript syntax by writing script that performs an action when a cue point is reached in a sound or quicktime file, you can synchronize a movie with sound or digital video. For more information about the following methods and properties, see the ...

  • Page 242

    242 chapter 10: sound and synchronization.

  • Page 243: Chapter 11

    243 chapter 11 using digital video you can give your macromedia director mx 2004 movie added appeal by including digital video. Digital video not only offers high-quality real-time image animation and sound, but also supports new types of media such as windows media audio and video files and dvd con...

  • Page 244

    244 chapter 11: using digital video • control quicktime vr • trigger events at key points in time for a video sprite's playback note: you can export movies or portions of movies as quicktime or avi videos. For more information, see “exporting digital video and frame-by-frame bitmaps” on page 465 . A...

  • Page 245

    Playing digital video direct-to-stage 245 using the video windows whether a digital video is a cast member or a sprite on the stage, you can preview it in its corresponding video window. There are different versions of the window for quicktime, windows media, dvd, realmedia, and avi digital content....

  • Page 246

    246 chapter 11: using digital video 4 if the cast member or sprite is a quicktime video, select one of the following playback options: sync to soundtrack makes the digital video skip frames (if necessary) to keep up with its soundtrack. The digital video might also take less time to play. Play every...

  • Page 247

    Playing digital video with lingo or javascript syntax 247 playing digital video with lingo or javascript syntax lingo or javascript syntax can take advantage of the most important and powerful features of digital video. Besides playing digital video linearly, lingo or javascript syntax can pause, st...

  • Page 248

    248 chapter 11: using digital video • to determine the stop time of a track in a digital video sprite or cast member, check the digital video’s trackstoptime sprite or cast member property. • to determine whether a sprite’s track is enabled to play, check the digital video’s trackenabled sprite prop...

  • Page 249

    Setting quicktime digital video cast member properties 249 7 to determine how a movie image appears within the sprite bounding rectangle when the movie is rotated, scaled, or offset, set the following framing options: crop displays the movie image at its default size. Any portions that extend beyond...

  • Page 250

    250 chapter 11: using digital video controlling quicktime with lingo or javascript syntax you can use lingo or javascript syntax to control a quicktime video’s appearance and sound volume. For quicktime vr, you can use lingo or javascript syntax to pan a quicktime vr digital video and specify what h...

  • Page 251

    Controlling quicktime with lingo or javascript syntax 251 • to determine the name of the handler that runs when the pointer leaves a quicktime vr hotspot that is visible on the stage, set the hotspotexitcallback property. • to specify the id of the current node that a quicktime vr sprite displays, s...

  • Page 252

    252 chapter 11: using digital video using windows media files in director director now fully supports windows media video and audio formats. Windows media format is a high-quality, secure, and comprehensive digital media format available for streaming and download-and-play applications on windows sy...

  • Page 253

    Using windows media files in director 253 4 in the filename text box, choose the file to be associated with the cast member. You can type the name of the file, or browse for the file by clicking the “…” button. 5 in the name text box, type a name for the new windows media cast member. Setting window...

  • Page 254

    254 chapter 11: using digital video using the windows media video window the windows media window lets you preview windows media audio and video files. You can also control windows media sprites using the this window. For more information, see “controlling windows media sprites using lingo or javasc...

  • Page 255

    Using dvd media content in director 255 linking to dvd media content you can link to dvd media content by using the insert menu or the dvd editor, or you can use scripting to set the folder property value. Setting the folder property will allow director to play dvds from the hard drive or from the r...

  • Page 256

    256 chapter 11: using digital video issues with macintosh dvd folder pathnames on macintosh computers, the format of the pathname for the folder property should use a forward slash ( / ) as the path’s delimeter, instead of the standard macintosh delimiter colon ( : ). In addition, / volumes/ should ...

  • Page 257

    Cropping digital video 257 setting dvd cast member properties the dvd property inspector lets you set the options for audio, close captioning, volume and whether or not the cast member pauses during playing. To set dvd cast member properties: 1 select a dvd cast member on the stage or in the cast wi...

  • Page 258

    258 chapter 11: using digital video 6 go to the stage and drag any of the handles that appear on the selection rectangle that surrounds the video image. Director displays only as much of the movie image as can fit in the area that is defined by the selection rectangle. If you would rather scale the ...

  • Page 259

    Using realmedia content in director 259 when you use streaming digital video in a movie that is distributed on the internet, remember the following points: • the video begins to play immediately unless the member’s pausedatstart property is set to true or the controller member property is set to tru...

  • Page 260

    260 chapter 11: using digital video system requirements to create shockwave movies containing realmedia content, the following must be installed: • director mx, which includes the xtra for realmedia. • realplayer 8 or realone player. (realnetworks products are available for download at www.Real.Com ...

  • Page 261

    Using realmedia content in director 261 realmedia sample file if you have realone player or realplayer 8 installed on your system and are familiar with director, viewing and using realmedia files in director is incredibly quick and easy. Before you begin reading this document, please view the realme...

  • Page 262

    262 chapter 11: using digital video you can have as many realmedia streams and cast members in your director movie as you want, as long as you play them consecutively, not concurrently. This version of director does not support playing multiple realmedia cast members at the same time. Realmedia vide...

  • Page 263

    Using realmedia content in director 263 realmedia stream playback in director, realmedia playback occurs at the cast member level, not the sprite level. Therefore, if you have two sprites of a cast member, and you apply a method or property to one of the sprites, the method applies to both sprites. ...

  • Page 264

    264 chapter 11: using digital video authoring tips review the following guidelines before you begin creating realmedia cast members and assembling your movie. • whenever possible, refer to sprites rather than cast members in lingo or javascript syntax. Because future versions of director may enable ...

  • Page 265

    Using realmedia content in director 265 to create a realmedia cast member using insert > media element: 1 select insert > media element > realmedia. 2 on the member tab in the property inspector, enter the name of the realmedia cast member and enter the url, or use the “...” button to browse to the ...

  • Page 266

    266 chapter 11: using digital video obtaining dynamic realmedia cast member properties when a realmedia cast member is initially created, the values that are listed in the property inspector for the dynamic properties— height , width , rect , and duration —are placeholder values. After you play the ...

  • Page 267

    Using realmedia content in director 267 the realmedia tab in the property inspector the realmedia tab in the property inspector displays the properties of realmedia cast members. To set or change the editable properties, you can use the property inspector or the script properties for realmedia. Even...

  • Page 268

    268 chapter 11: using digital video • username (realmedia) lets you specify a user name if the cast member references a protected url. For security purposes, after a user name has been entered, it cannot be retrieved. If this property has been set, the value that appears in the property inspector is...

  • Page 269

    Using realmedia content in director 269 realmedia slider knob lets a graphic sprite function as a slider to control and monitor the playback location (current time) of the realmedia sprite with the realmedia target behavior attached. When the user drags a sprite that has this behavior attached, a se...

  • Page 270

    270 chapter 11: using digital video 7 create a field on the stage to display playback information about the realmedia sprite similar to the information that appears in the status bar of the realmedia viewer. 8 drag the realmedia stream information behavior to the field; then select the type of infor...

  • Page 271

    Using realmedia content in director 271 previous cast member (left arrow) lets you view the previous realmedia cast member (in the current cast) in the viewer. Play initiates the streaming process for the current realmedia cast member. For more information about the streaming process, see the state ...

  • Page 272

    272 chapter 11: using digital video to add the xtra for realmedia to your movie: 1 select modify > movie > xtras to display the movie xtras dialog box. 2 select realmedia asset.X32 in the list. If realmedia asset.X32 does not appear in the list, click the add button, and select it in the add xtras d...

  • Page 273

    Using lingo or javascript syntax sound elements with realmedia 273 unsupported sound elements the following lingo or javascript syntax elements are not supported for realmedia cast members or for sound channels playing the audio portion of a realmedia stream: • breakloop() • channelcount • endtime •...

  • Page 274

    274 chapter 11: using digital video.

  • Page 275: Chapter 12

    275 chapter 12 behaviors a behavior in macromedia director mx 2004 is prewritten lingo or javascript syntax that you use to provide interactivity and add interesting effects to your movie. You drag a behavior from the library palette and drop it on a sprite or frame to attach it. If the behavior inc...

  • Page 276

    276 chapter 12: behaviors to attach a behavior to a single sprite or frame using the library palette: 1 select window > library palette. 2 select a library from the library pop-up menu in the upper left corner of the palette. 3 to view a brief description of included behaviors, move the pointer over...

  • Page 277

    Attaching behaviors 277 5 to attach a behavior to a frame in the behavior channel, drag a behavior from the library palette to a frame in the behavior channel. 6 enter parameters for the behavior in the parameters dialog box. Note: if you attach a behavior from a director library of behaviors, the b...

  • Page 278

    278 chapter 12: behaviors changing the order of attached behaviors director executes behaviors in the order they were attached to a sprite, and they are listed in this order in the property inspector and behavior inspector. It is sometimes necessary to change the sequence of behaviors so that action...

  • Page 279

    Creating and modifying behaviors 279 creating and modifying behaviors without any scripting or programming experience, you can use the behavior inspector to create and modify behaviors to perform basic actions. To create behaviors with more complex structures, you must understand scripting in lingo ...

  • Page 280

    280 chapter 12: behaviors you can choose as many actions as you need for a single event. ■ to change an existing event or action group, select an event from the list and then add or remove actions in the actions list. ■ to delete an event or action group, select the event and press delete. ■ to chan...

  • Page 281

    Writing behaviors with lingo or javascript syntax 281 go to marker moves the playhead to the specified marker. Go to net page goes to the specified url. Wait on current frame waits at the current frame until another behavior or script advances to the next frame. Wait until click waits at the current...

  • Page 282

    282 chapter 12: behaviors • the behavior can have parameters that users edit from the parameters dialog box. The optional on getpropertydescriptionlist handler sets up the parameters dialog box. For more information, see the scripting reference topics in the director help panel. • a description of t...

  • Page 283

    Customizing a behavior’s property 283 customizing a behavior’s property if a behavior’s script includes an on getpropertydescriptionlist handler, director lets users set the property’s initial values from the parameters dialog box. The behavior’s parameters dialog box opens in three circumstances: •...

  • Page 284

    284 chapter 12: behaviors • #range specifies a range of possible values that the user can assign to the property. Specify the possible values as a list. To specify a range between a minimum and maximum number, use the form [ #min:minimum, #max:maximum ] . The example sets the range from 1 to 10. Whe...

  • Page 285

    Example of a complete behavior 285 // javascript syntax function getpropertydescriptionlist() { var description = new array(); description[#movement] = [:] description[#movement][#default] = 5 description[#movement][#format] = #integer description[#movement][#comment] = "set motion to the right:" de...

  • Page 286

    286 chapter 12: behaviors description = [:] description[#movement] = \ [#default: 5, \ #format:#integer, \ #comment: "set motion to the right:", \ #range: [#min:1, #max:10] \ ] description[#noise] = \ [#default:"", \ #format: #sound, \ #comment:"sound cast member name" \ ] return description end // ...

  • Page 287

    Sending messages to behaviors attached to sprites 287 sending messages to behaviors attached to sprites script can run handlers in behaviors attached to specific sprites by sending messages to the behaviors attached to one sprite, all sprites, or several specific sprites. Sending messages to a sprit...

  • Page 288

    288 chapter 12: behaviors sending messages to specific behaviors only the call method sends an event to specific behaviors. Unlike the sendsprite method, the call method does not pass the message to frame scripts, scripts of the cast member, or movie scripts. Before sending a message to a specific b...

  • Page 289

    Using inheritance in behaviors 289 using inheritance in behaviors behaviors can have ancestor scripts in the same way that parent scripts do. (ancestor scripts are additional scripts whose handlers and properties a parent script can call on and use.) • the ancestor’s handlers and properties are avai...

  • Page 290

    290 chapter 12: behaviors.

  • Page 291: Chapter 13

    291 chapter 13 navigation and user interaction adding interactivity lets you involve your audience in your macromedia director mx 2004 movies. Using the keyboard, the mouse, or both, your audience can download content from the internet, jump to different parts of movies, enter information, move obje...

  • Page 292

    292 chapter 13: navigation and user interaction to use basic navigation behaviors: 1 create a movie that contains a sprite in frame 1 and at least one marker in a later frame. 2 select window > library palette, and select the navigation library. 3 drag hold on current frame to frame 1 in the script ...

  • Page 293

    Jumping to locations with lingo or javascript syntax 293 jumping to locations with lingo or javascript syntax the lingo or javascript syntax navigation features can make a movie jump to other frames, to other movies, or to internet movies and web pages. You can also use script to make a movie appear...

  • Page 294

    294 chapter 13: navigation and user interaction jumping away and returning to the original location you might want a movie to jump to a different frame or a separate movie and then return to the original frame. For example, at a website that describes the weather, you could jump to a movie segment t...

  • Page 295

    Making sprites editable or moveable with lingo or javascript syntax 295 making sprites editable and draggable using the property inspector, you can make a sprite editable, draggable, or both while your movie is running. For more information, see “displaying and editing sprite properties in the prope...

  • Page 296

    296 chapter 13: navigation and user interaction checking which text is under the pointer with lingo or javascript syntax lingo or javascript syntax can detect which text component in a text or field cast member is currently under the mouse pointer. For more information, see the scripting reference t...

  • Page 297

    Checking keys with lingo or javascript syntax 297 • to set up script that runs when the mouse pointer is within a sprite’s bounding rectangle when the playhead enters the frame that contains the sprite, place the script in an on mousewithin event handler. The mousewithin event can occur repeatedly a...

  • Page 298

    298 chapter 13: navigation and user interaction equivalent cross-platform keys because of inherent differences between windows and macintosh keyboards, keys on windows and macintosh computers don’t always correspond directly. This discrepancy can create confusion because script often uses the same t...

  • Page 299

    Creating an animated color cursor cast member 299 xtra extensions that support animated cursors the director installation program places two animated color cursor files in the media support folder within the director application’s xtras folder. The specific files depend on the platform you are using...

  • Page 300

    300 chapter 13: navigation and user interaction to create an animated color cursor cast member: 1 select insert > media element > cursor. Director opens the cursor properties editor, which you use to set up the cursor. 2 from the cast pop-up menu, select the cast that contains the cast member you wa...

  • Page 301

    Using an animated color cursor in a movie 301 using an animated color cursor in a movie after you add an animated color cursor to the cast, use script to switch to the animated cursor as you would any other cursor. You can set up an animated cursor as the movie’s cursor or a sprite’s cursor. To swit...

  • Page 302

    302 chapter 13: navigation and user interaction.

  • Page 303: Chapter 14

    303 chapter 14 3d basics macromedia director mx 2004 lets you bring robust, high-performance 3d graphics to the web. With director, you can develop a wide spectrum of 3d productions, ranging from simple text handling to interactive product demonstrations to complete immersive game environments. Usin...

  • Page 304

    304 chapter 14: 3d basics about 3d in director mx 2004 the following are the main components that are common between director mx 2004 and earlier versions of director: • the stage is the authoring area in which the director movie is assembled. • the score displays the arrangement of channels that or...

  • Page 305

    The 3d xtra 305 • the behavior inspector lets you create and modify behaviors. For an introduction to the behavior inspector, see “3d behaviors” on page 312 . For a full discussion, see “using 3d behaviors” on page 327 . • director provides easy but powerful 3d text handling. For more information, s...

  • Page 306

    306 chapter 14: 3d basics using the shockwave 3d window the shockwave 3d window provides an easy way for you to inspect a 3d cast member. Some properties of 3d cast members can also be edited in this window. To use the shockwave 3d window: 1 select a 3d cast member in the cast. 2 click the shockwave...

  • Page 307

    Using the shockwave 3d window 307 3 use the following controls: ■ the camera buttons along the side—dolly, rotate, and pan—let you change your viewing angle by zooming in and out, moving around the world origin, and moving in a straight line horizontally or vertically, respectively. Hold the shift k...

  • Page 308

    308 chapter 14: 3d basics using the property inspector for 3d with the property inspector, you can modify the 3d cast member without using script. The 3d model tab of the property inspector offers a simple way to view and control numerous aspects of the 3d world. To view the 3d model tab: 1 open the...

  • Page 309

    Using rendering methods 309 • the director light area lets you select one of ten lighting positions to apply to a single directional light. You can also adjust the color for the ambient light. (directional light comes from a particular, recognizable direction; ambient light is diffuse light that ill...

  • Page 310

    310 chapter 14: 3d basics to choose a rendering method: 1 select the stage. 2 open the property inspector. 3 click the movie tab. 4 select a rendering method from the pop-up menu. If you don’t select a rendering method, director defaults to #auto . Below the pop-up menu, the name of the active 3d re...

  • Page 311

    Using 3d anti-aliasing 311 determining whether anti-aliasing is supported not all 3d renderers can perform the additional calculations that anti-aliasing requires. If you have a 3d sprite that you want to anti-alias, check first that the 3d renderer supports anti-aliasing. The renderers that current...

  • Page 312

    312 chapter 14: 3d basics end on mouseup -- stop animation -- the interaction/animation has ended so turn -- anti-aliasing on sprite(1).Antialiasingenabled = true end // javascript syntax function mousedown() { // user interaction/animation is about to start so turn // anti-aliasing off sprite(1).An...

  • Page 313

    The 3d world 313 the 3d world this section provides a brief overview of the contents of 3d cast members. For more detailed information, see “about the 3d cast member” on page 315 . Each 3d cast member contains a complete 3d world. It can contain models (the objects that viewers see within the world)...

  • Page 314

    314 chapter 14: 3d basics lights and cameras lights are used to light the 3d world. Without lights, the objects within the world can’t be seen. Although lights control the appearance of the 3d world, cameras control how a sprite views the 3d world. A 3d sprite displays a particular camera’s view int...

  • Page 315: Chapter 15

    315 chapter 15 the 3d cast member, 3d text, and 3d behaviors several macromedia director mx 2004 features let you create a 3d movie: • a 3d cast member contains a complex internal structure that includes model resources, models, lights, and cameras. Each of these objects has its own array of propert...

  • Page 316

    316 chapter 15: the 3d cast member, 3d text, and 3d behaviors • cameras are views into the 3d cast member. Each sprite that uses a given cast member can display the view from a different camera. For more information about sprites, see chapter 14, “3d basics,” on page 303 . • groups are clusters of m...

  • Page 317

    Model resources 317 the following cast member methods and properties perform basic model resource operations: method function returns modelresource. Count returns the number of model resource objects included in the cast member. Integer. Modelresource(name) returns the model resource named name . Re...

  • Page 318

    318 chapter 15: the 3d cast member, 3d text, and 3d behaviors models the models in a cast member are the actual visible objects that are seen in the 3d cast member. Models move according to the motions you assign to them in your 3d modeling software, and according to animation scripts that you write...

  • Page 319

    Shaders 319 shaders a shader defines the basic appearance of a model’s surface. You apply textures to shaders. The standard shader is photorealistic. The following list describes some of the other available shaders: • #painter , which looks like a painted surface • #engraver , which looks like an en...

  • Page 320

    320 chapter 15: the 3d cast member, 3d text, and 3d behaviors textures textures are 2d images that are drawn on the surface of a 3d model. Textures can be assigned to models in your 3d modeling software, or you can use any bitmap cast member in your movie. You can also use any image object created u...

  • Page 321

    Lights 321 motions a motion is an animation of a model. Motions can be shared by multiple models. A 3d cast member contains a palette of motions that are available to any model in the world. The following cast member methods and properties can be used to perform basic motion operations: lights model...

  • Page 322

    322 chapter 15: the 3d cast member, 3d text, and 3d behaviors the following methods and properties can be used to perform basic light operations: cameras cameras provide different views of the 3d world. A 3d cast member can have many cameras. Each sprite that uses the cast member can display a diffe...

  • Page 323

    Groups 323 groups groups are collections of models and other objects that are formally associated with one another. These associations can be created in your 3d modeling software or with script. Each 3d cast member has a default group called world, which is the cast member. Groups simplify the rotat...

  • Page 324

    324 chapter 15: the 3d cast member, 3d text, and 3d behaviors creating 3d text to create 3d text, you first create 2d text, and then you convert the text to 3d. Note: alternatively, you can use the extrude3d() method of a 3d cast member to create an extruded- text model resource in the cast member. ...

  • Page 325

    Script and 3d text 325 3 select from among the front face, back face, and tunnel check boxes. These options control which sides of the text appear. 4 set the smoothness. This determines the number of polygons that are used to construct the text. The more polygons that are used, the smoother the text...

  • Page 326

    326 chapter 15: the 3d cast member, 3d text, and 3d behaviors exceptions the following methods and properties work differently when used with 3d text. Lingo and javascript syntax script for 3d text in addition to working with most existing methods and properties, 3d text also adds some properties of...

  • Page 327

    Using 3d behaviors 327 these properties can be set while the text is in 2d mode. They have no visible effect until the text appears in 3d mode. When you access the properties listed in the following table for an extruded 3d text model that you created by using the extrude3d method, you must refer to...

  • Page 328

    328 chapter 15: the 3d cast member, 3d text, and 3d behaviors behavior types director provides two types of 3d behaviors: trigger and action. Action behaviors are divided into three types: local, public, and independent. These behavior types and subtypes are defined in the following table. If you’re...

  • Page 329

    Using 3d behaviors 329 the following table describes the available triggers. You can add modifier keys to any trigger, so that a given trigger can launch two actions, depending on whether the modifier key is pressed. You can, for example, use mouse left and mouse left+shift as separate triggers. To ...

  • Page 330

    330 chapter 15: the 3d cast member, 3d text, and 3d behaviors local actions when you attach a local action to a sprite, that action responds only to a trigger that is attached to that same sprite. The following table describes the available local actions. Public actions as with local actions, you ca...

  • Page 331

    Using 3d behaviors 331 independent actions independent actions don’t require triggers. The following table describes the available independent actions. Pan camera horizontal camera pans along the horizontal axis by a specified number of degrees each time the trigger action occurs. Panning left and p...

  • Page 332

    332 chapter 15: the 3d cast member, 3d text, and 3d behaviors applying 3d behaviors you apply 3d behaviors in the same way as standard behaviors in director. You can attach as many behaviors to a sprite as needed, but each behavior that requires a trigger must have a unique trigger to activate it. T...

  • Page 333

    Using 3d behaviors 333 6 for local behaviors, attach a trigger behavior to the same sprite. For public behaviors, attach a trigger behavior to a specific sprite. The parameters dialog box appears. You can use this dialog box to control when the trigger should work; what modifier keys, if any, are as...

  • Page 334

    334 chapter 15: the 3d cast member, 3d text, and 3d behaviors.

  • Page 335: Chapter 16

    335 chapter 16 working with models and model resources this chapter covers the lingo or javascript syntax methods and properties used to work with models and model resources, as well as lights and cameras to enhance macromedia director mx 2004 three-dimensional (3d) movies. For more information abou...

  • Page 336

    336 chapter 16: working with models and model resources model resources model resources are 3d geometries defined in 3d modeling software or created in director mx 2004 by scripting in lingo or javascript syntax. A model is an object that makes use of a model resource’s geometry and occupies a parti...

  • Page 337

    Primitives 337 primitives each type of primitive has its own set of methods and properties used to define its appearance. Use the newmodelresource() method to create the various primitives at runtime. Exceptions include mesh model resources, which require you to use the newmesh() method, and extrude...

  • Page 338

    338 chapter 16: working with models and model resources box properties boxes have a type property of #box . Box properties can be modified or animated at runtime. Resolution get and set number of polygonal segments around the circumference of the circle. Controls the smoothness of the cylinder’s app...

  • Page 339

    Primitives 339 plane properties planes are the default director primitive. Planes, whose type property is #plane , are generated in the xz plane with script. Plane properties can be modified or animated at runtime. Mesh generator properties the mesh generator is the most complex model resource. It a...

  • Page 340

    340 chapter 16: working with models and model resources use these properties to work with mesh primitives: property access description value range vertexlist get and set vector values for each vertex in the mesh. Several faces may share a single vertex. Set the value to the number of vectors specifi...

  • Page 341

    Primitives 341 face[index]. Normals get and set list indicating which normals to use for faces at designated index points. Set the value to a list of three integers specifying the indexes of the normals in the normallist that each point of the triangle should use. Don’t set a value if you aren’t def...

  • Page 342

    342 chapter 16: working with models and model resources mesh generator methods use these methods to work with mesh primitives: particle system properties particle systems are unique among model resources in that they include animation by default. Particle systems, whose type is #particle , can have ...

  • Page 343

    Primitives 343 sizerange. End get and set size of a particle at the end of its life. The size is linearly interpolated between startsize and endsize . Positive integer. The default is 1 . Blendrange. Start get and set opacity of a particle at the start of its life. Any value between 0.0 and 100.0 . ...

  • Page 344

    344 chapter 16: working with models and model resources the extruder model resource you can create extruder model resources only by using an existing text cast member. In many cases, you may choose to use the 3d text capabilities of the property inspector instead. Creating an extruder model resource...

  • Page 345

    Cast member methods 345 cast member methods if the models and model resources you need aren’t contained in a particular cast member, the following methods let you create models and model resources using other 3d cast members at runtime. Method description returns loadfile (filename, overwrite, gener...

  • Page 346

    346 chapter 16: working with models and model resources models models can be referred to by name or number. Models can be added to or removed from the world at any time. In the member’s parent-child hierarchy, each model can have a maximum of one parent, but it can have an unlimited number of childr...

  • Page 347

    Models 347 node types a model is one of four types of objects that share the same transform, parent, and child properties. The others are cameras, lights, and groups. Models, cameras, lights, and groups are generically referred to as node types or nodes. Nodes can be each other’s parents or children...

  • Page 348

    348 chapter 16: working with models and model resources bounding sphere get a list containing a vector and a floating-point value. The vector represents the world position and the value represents the radius of a bounding sphere surrounding the model and all its children. [vector (0,0,0), 0.0] world...

  • Page 349

    Models 349 model methods use these methods to work with models: method description returns addchild(anode, preserveworld) adds anode to this model’s list of children. An equivalent operation is to set anode.Parent to equal this model . The preserveworld argument is optional. It can have two values: ...

  • Page 350

    350 chapter 16: working with models and model resources isinworld() returns a boolean value indicating if the model is currently in the world (true) or not (false). This is useful for detecting if a given node's parent- heirarchy tree terminates with the world group object or not. True (1) or false ...

  • Page 351

    Models 351 moving models because the 3d world has no absolute frame of reference, moving and rotating is much more complex than in 2d, where all movement is in relation to screen position. In 3d, everything is drawn relative to the camera’s frame of reference. If the camera is behind an object, when...

  • Page 352

    352 chapter 16: working with models and model resources or car.Child[1].Rotate(0,10,0, #self) where the fourth parameter of the rotate method is the object the rotation should be relative to. • parent-relative: a model’s transform property expresses its position and rotation relative to the model’s ...

  • Page 353

    Shaders 353 shininess get and set an integer between 0 and 100 indicating how shiny a surface is. 30.0 emissive get and set a color object describing the color of light this object seems to give off. This does not turn the surface using this shader into a light source; it just gives it the appearanc...

  • Page 354

    354 chapter 16: working with models and model resources texturelist [index] get and set a shader can use up to eight layers of textures. This property gives access to the texture at the indicated index position. Void texture get and set this property allows access to the texture for the first layer....

  • Page 355

    Shaders 355 texturemode list[index] get and set this property allows access to the texture coordinate generation method used for a texture at the texture level and then to allows you to change how textures are applied to a model’s surface. The property can take the following values: #none #wrapplana...

  • Page 356

    356 chapter 16: working with models and model resources wraptransform list get and set controls the orientation of uv generation in model space. Get: returns a list of texture coordinate generation transforms, one per layer. Set: specifies a texture coordinate generation transform to be applied to a...

  • Page 357

    Shaders 357 blendfunction list[index] get and set access to the blending method associated with a texture layer at the position indicated by index , which must be a positive integer smaller than or equal to 8. Possible values are as follows: #replace #multiply #add #blend #alpha #constant for detail...

  • Page 358

    358 chapter 16: working with models and model resources blendconstant list[index] get and set the blending ratio used for a specific layer when the blend method is set to #blend and blendsourcelist[index] is set to #constant . Returns a floating- point value from 0.0 to 100.0 . 50.0 blendconstant li...

  • Page 359

    Shaders 359 properties of the painter shader the #painter shader gives the model a painted effect. Use these properties to work with the painter shader: properties of the newsprint shader the #newsprint shader creates a dithering effect similar to a newspaper photograph. Use these properties to work...

  • Page 360

    360 chapter 16: working with models and model resources properties of the engraver shader the #engraver shader gives the effect of an engraved metal surface. You can control the size and number of etched lines by adjusting the brightness and density properties, respectively. Use these properties to ...

  • Page 361

    Textures 361 width get width, in pixels. None height get height, in pixels. None quality get and set property with the following possible values: #low : texture is not mipmapped #medium : mipmapping is at a low bilinear setting (default) #high : the mipmapping is at a high trilinear setting for more...

  • Page 362

    362 chapter 16: working with models and model resources texture methods the pixel height and width of the 2d images you use as textures should be powers of 2 (that is, 2, 4, 8, 16, 32, and so on). If not, the image will be resized to a dimension that is a power of 2. The scaledown() method lets you ...

  • Page 363

    Groups 363 groups groups have many of the same properties and methods as models, except that you need to substitute the word group for the word model when writing scripts. A group is a node that can have a parent and/or children. These can be models, lights, cameras, or other groups. Group propertie...

  • Page 364

    364 chapter 16: working with models and model resources group methods use these methods to work with groups: method description returns addchild(anode, preserveworld) adds anode to this group’s list of children. An equivalent operation is to set anode.Parent to equal this group . The preserveworld a...

  • Page 365

    Groups 365 registerscript (eventname, handlername, scriptinstance) registers a handler named handlername that is called in the scriptinstance when the member method sendevent() is called with eventname as an argument. If scriptinstance is 0, a movie script handler is called. The user defines what ev...

  • Page 366

    366 chapter 16: working with models and model resources modifiers modifiers control how a model is rendered or how it animates. They are attached to a model with the addmodifier() method. Once a modifier has been attached, its properties can be manipulated with script. The tables that follow detail ...

  • Page 367

    Modifiers 367 use these properties to work with the level of detail modifier: property access description default whichmodel.Lod.Auto get and set true (1) means that polygons are automatically reduced based on the distance from the camera. The fewer polygons that are drawn, the faster performance wi...

  • Page 368

    368 chapter 16: working with models and model resources toon modifier properties the toon modifier changes a model’s rendering to imitate a cartoon drawing style. Only a few colors are used, and the model’s shader, texture, and related properties are ignored. Use these properties to work with the to...

  • Page 369

    Modifiers 369 use these properties to work with the inker modifier: subdivision surfaces modifier properties the subdivision surfaces (sds) modifier causes the model to be rendered with additional geometric detail in the area of the model that the camera is currently looking at. The additional detai...

  • Page 370

    370 chapter 16: working with models and model resources collision modifier properties the collision modifier allows a model to be notified of and respond to collisions. You can access a model’s collision modifier properties using syntax such as model.Collision. Whichproperty . Detecting collisions a...

  • Page 371

    Modifiers 371 collision modifier methods use this method to work with the collision modifier: whichmodel.Collision.I mmovable get and set true (1) or false (0) value indicating whether the model can be moved. If a model cannot be moved, the 3d xtra can save time by not checking it for collisions wit...

  • Page 372

    372 chapter 16: working with models and model resources collision modifier events these events are generated when collisions occur: animation modifiers once you’ve created animations in your modeling software, you apply animation modifiers to models to play them back in director. Director supports b...

  • Page 373

    Animation modifiers 373 you can add the keyframe player modifier at runtime to a model created in director, but you cannot add the bones player modifier at runtime. The bones player modifier is automatically attached to models with bones animation exported from a 3d modeling application. Since the r...

  • Page 374

    374 chapter 16: working with models and model resources bones player properties use these properties to work with bones animations: property access description default whichmodel.Bonesplay er.Playing get true (1) = playing; false (0) = paused. True (1) whichmodel. Bonesplayer. Playlist get a linear ...

  • Page 375

    Animation modifiers 375 whichmodel. Bonesplayer. Autoblend get and set if true , automatic linear blending (from 0.0 to 100.0) is applied over the blend time. Otherwise, blendtime is ignored, and the amount of blending is user- determined by the blendfactor property. True (1) whichmodel. Bonesplayer...

  • Page 376

    376 chapter 16: working with models and model resources bones player events these events are generated by bones animations: whichmodel. Bonesplayer. Rotationreset get and set normally a model snaps back to its original rotation after a motion finishes playing. This property maintains any or all of t...

  • Page 377

    Animation modifiers 377 keyframe player methods use these methods to work with keyframe animations: method description returns whichmodel.Keyframeplayer.Play ("name", looped, starttime, endtime, playrate, timeoffset) plays the motion named name starting at the time starttime , with the currently pla...

  • Page 378

    378 chapter 16: working with models and model resources keyframe player properties use these properties to work with keyframe animations: property access description returns whichmodel. Keyframeplayer. Playing get true (1) = playing; false (0) = paused. True (1) whichmodel. Keyframeplayer. Playlist ...

  • Page 379

    Animation modifiers 379 whichmodel. Keyframeplayer. Blendfactor get and set the degree of blending between motions, expressed as a floating-point value between 0.0 and 100.0 . A value of 0.0 uses all the previous motion. A value of 100.0 uses all of the next motion. The blendfactor can be changed fr...

  • Page 380

    380 chapter 16: working with models and model resources keyframe player events these events are generated by keyframe animations: mesh deform modifier properties the mesh deform modifier lets you alter an existing model resource’s geometry at runtime. You can create twist, bend, and ripple effects. ...

  • Page 381

    Motions 381 motions motions are simply animations that have been predefined in a 3d modeling application. They are included in the file that’s exported from the 3d application and imported into director. Motions can be reused on any model in the 3d cast member, as long as the motion is appropriate t...

  • Page 382

    382 chapter 16: working with models and model resources motion methods use this method to work with motions: about lights and cameras lights illuminate the 3d world and the models in it. Without lights, the world exists, and actions can take place, but users see nothing. You can add lights to your 3...

  • Page 383

    Light properties 383 light properties use these properties to work with lights: property name access description default name get unique name of this light. If the light was exported from a 3d modeling package, the name is the name assigned there. None parent get and set the model, light, camera, or...

  • Page 384

    384 chapter 16: working with models and model resources light methods use these methods to work with lights: spotangle get and set angle of the light’s projection cone. If type equals #spot , setting a value less than the umbra causes a “property not found” error. 90.0 attenuation get and set a thre...

  • Page 385

    Light methods 385 clone(name) clones a light named name , adds it to light’s parent’s child list, and adds it to the world. All children of the light are automatically cloned.This can be avoided by removing the children, performing the cloning operation, and then adding the children back. If the nam...

  • Page 386

    386 chapter 16: working with models and model resources cameras cameras act as view ports into the 3d world. By default, a newly added camera’s view is positioned at the world’s origin, the vector (0,0,0), and looks down the negative z-axis. Changing a camera’s transform property affects the camera’...

  • Page 387

    Cameras 387 camera properties use these properties to work with cameras: property name access description default name get and set unique name of this camera. If the camera was exported from a 3d modeling program, the name is the name assigned there. None parent get and set the model, light, camera,...

  • Page 388

    388 chapter 16: working with models and model resources colorbuffer. Clearatrender get and set true (1) or false (0) value indicating whether color buffer is or isn’t cleared out after each frame. If value is set to false (2) , the effect is similar to the trails ink effect, although it requires a s...

  • Page 389

    Cameras 389 overlay[index]. Loc get and set location, in pixels, of the overlay, as measured from the upper left corner of the sprite’s rect to the overlay[index].Source’s regpoint . Point(0,0) overlay[index]. Source get and set texture object used as the source for this overlay. None overlay[index]...

  • Page 390

    390 chapter 16: working with models and model resources camera methods use these methods to work with cameras: boundingsphere get a list containing a vector and a floating-point value, with the vector representing the position and the value the radius of a bounding sphere surrounding the camera and ...

  • Page 391

    Cameras 391 isinworld() returns a boolean value indicating if the camera is currently in the world (true) or not (false). This is useful for detecting if a given node's parent-heirarchy tree terminates with the world group object or not. True (1) or false (0) registerscript (eventname, handlername, ...

  • Page 392

    392 chapter 16: working with models and model resources.

  • Page 393: Chapter 17

    393 chapter 17 controlling the 3d world macromedia director mx 2004 provides powerful methods for overall control of the three-dimensional (3d) world, including lingo and javascript syntax for handling new 3d- generated events, selecting models (picking), vector math operations, and transforms. In a...

  • Page 394

    394 chapter 17: controlling the 3d world use these methods to set up event handling: collisions by attaching the collision modifier ( #collision ) to a model, you can enable that model to automatically respond to collisions with other models. By using the properties of the collision modifier, you ca...

  • Page 395

    Collisions 395 these properties are included in the collisiondata object passed to the handler: collision methods collision methods let you override certain aspects of the default behavior set for models during collisions. If neither of the models involved in the collision has resolve set to true , ...

  • Page 396

    396 chapter 17: controlling the 3d world camera methods these camera methods let you determine which models have been clicked when a user clicks the mouse within a 3d sprite. You can also translate coordinates in 3d space to coordinates in 2d sprite space and vice versa. Method description returns w...

  • Page 397

    Vector math 397 vector math a 3d vector describes both direction and location in 3d space. Vector objects include floating- point values for position along each of the x-, y-, and z-axes. Vectors can be node-relative or world-relative. If they are node-relative, their x, y, and z values are relative...

  • Page 398

    398 chapter 17: controlling the 3d world vector methods use these methods to work with vectors: vector binary operations use these syntaxes to perform additional vector math calculations: note: javascript does not support these operations for vector objects. In javascript, you must write the code to...

  • Page 399

    Transforms 399 transforms a transform is a data object describing a model’s position, orientation, and scale in the 3d world. Transform methods can be used to move a given vector, light, camera, or model from its current location to a new position and/or orientation. Transform creation method use th...

  • Page 400

    400 chapter 17: controlling the 3d world rotation get and set script vector object describing the xrotation , yrotation , and zrotation components of the transform with the value vector(xrotation, yrotation, zrotation) , with the rotation values defined in degrees. This value can vary because of the...

  • Page 401

    Transforms 401 transform methods use these methods to work with transforms: method description returns rotate (xangle, yangle, zangle) applies a rotation transformation after the current transformation: model.Transform.Identity() model.Transform.Translate(100,0,0) model.Transform.Rotate(0,0,90) afte...

  • Page 402

    402 chapter 17: controlling the 3d world pretranslate (xincrement, yincrement, zincrement) translates the position of the transform before the current transformation: model.Transform.Identity() model.Transform.Rotate(0,90,0) model.Transform.Translate(100,0,0) after this series of transformations, pe...

  • Page 403

    Rendering functionality 403 transform operator use the asterisk (*) to multiply two transforms: rendering functionality the director global rendererservices object encapsulates information about the functionality common to all 3d cast members and sprites in a movie. It provides a single place to que...

  • Page 404

    404 chapter 17: controlling the 3d world modifiers get a list of modifiers available for 3d cast members. Possible values are as follows: #lod #toon #sds #bonesplayer #keyframeplayer #inker #collision #meshdeform none primitives get a list of basic 3d shapes available for all 3d cast members. Possib...

  • Page 405

    Rendering functionality 405 movie properties use these properties to control which renderer the movie uses: colorbuffer depth get either 16 or 32, depending on the hardware card. Controls the precision of the hardware output buffer. None gethardware info() returns a property list of the specifics of...

  • Page 406

    406 chapter 17: controlling the 3d world cast member properties you can control most cast member properties using the property inspector. For more information, see “using the property inspector for 3d” on page 308 . Use the following properties to work with 3d cast members in script: property access...

  • Page 407

    Rendering functionality 407 cast member methods the following methods let you reset cast member properties to original values they had at the time the cast member was imported into director: diffusecolor get and set diffuse color of first shader: the shader’s overall color. Rgb(255, 255,255) texture...

  • Page 408

    408 chapter 17: controlling the 3d world sprite properties you can control the directtostage and bgcolor properties using the property inspector. For more information, see “using the property inspector for 3d” on page 308 . Use the following properties to work with 3d sprites in scripts.: sprite met...

  • Page 409: Chapter 18

    409 chapter 18 movies in a window macromedia director mx 2004 can play several movies simultaneously by creating windows in which additional movies can play. A movie in a window (miaw) is a distinct director movie that retains all its interactivity. You can use a miaw to play another movie in a sepa...

  • Page 410

    410 chapter 18: movies in a window about miaws a miaw is the combination of a window object and a movie object. In fact, there is no such thing as a miaw object, but it is the name used to describe the concept of this unique combination of window and movie objects. Most of the properties described i...

  • Page 411

    Opening and closing a miaw 411 to open a miaw: • use the following script: -- lingo window().New("moviename") window("moviename").Open() -or- window().New("moviename").Open() // javascript syntax new window("moviename"); window("moviename").Open(); -or- new window("moviename").Open(); unless you exp...

  • Page 412

    412 chapter 18: movies in a window setting the window size and location for a miaw setting the screen coordinates for a miaw lets you control the size of the window and where it appears. Setting the coordinates before the movie appears controls the initial position of the window; setting them after ...

  • Page 413

    Controlling the appearance of a miaw 413 controlling the appearance of a miaw you can control the appearance of a miaw by setting different appearance properties. You can do this by using lingo or javascript syntax. Some default appearance properties can also be set by using the display template tab...

  • Page 414

    414 chapter 18: movies in a window minimize box determines if a minimize box appears in the title bar. For example: window("window_name").Titlebaroptions.Maximizebox = true visible determines whether the title bar of a window is visible. When you set this property to false, the other options (maximi...

  • Page 415

    Controlling the appearance of a miaw 415 window appearance methods there are several new window appearance methods in director mx 2004 that apply to miaws. For more information about these methods, see the scripting reference topics in the director help panel. The following are three of these method...

  • Page 416

    416 chapter 18: movies in a window controlling miaw layering to control whether a movie appears in front of or behind other windows: • use the movetofront() and movetoback() methods. For more information about these methods, see the scripting reference topics in the director help panel. This code mo...

  • Page 417

    Controlling interaction between miaws 417 for more information, see the scripting reference topics in the director help panel. Listing the current miaws the windowlist property displays a list of all known miaws in the main movie. For example, the following statement displays a list of current miaw ...

  • Page 418

    418 chapter 18: movies in a window.

  • Page 419: Chapter 19

    419 chapter 19 using the xml parser xtra the xml parser xtra lets macromedia director mx 2004 movies read, parse, and use the contents of extensible markup language (xml) documents. Using the xml parser xtra requires that you understand the structure and content of the documents you are parsing. You...

  • Page 420

    420 chapter 19: using the xml parser xtra there are many sources of information for understanding, creating, and editing xml on the internet. The following websites offer useful information about xml: • www.Xml.Com • www.Ucc.Ie/xml/ • www.W3.Org/tr/rec-xml • www.W3.Org/dom/ using xml parser objects ...

  • Page 421

    Using xml parser objects 421 the following example shows a short xml document: element 2element 3 the following example is the same xml with its tree structure shown more clearly: element 2 element 3 there are two ways to access a parsed xml document. You can use the makelist() method to convert the...

  • Page 422

    422 chapter 19: using the xml parser xtra errcode = gparserobject.Parsestring(member("xmltext").Text) thelist = gparserobject.Makelist() after this code has been executed, the variable gparserobject contains the parsed node structure of the xml document, and the variable thelist is a property list t...

  • Page 423

    Using xml document nodes 423 using this xml document as a starting point, the following examples demonstrate how to use these script terms to access the data within various node levels of the xml structure. The xml looks like the following example: element 2 element 3 here is some text the following...

  • Page 424

    424 chapter 19: using the xml parser xtra this script returns the text of the fourth child of the e1 tag, as shown in the following example: put gparserobject.Child[1].Child[4].Text -- " here is some text " the text element includes the white space for return, space, and tab characters as well as th...

  • Page 425

    Xml and character sets 425 the following script returns the root node’s type, name, and number of children: put gparser.Type, gparser.Name, gparser.Count(#child) -- #element "root of xml document" 1 the main difference between the root node and its child nodes is that there are several script method...

  • Page 426

    426 chapter 19: using the xml parser xtra this requirement applies to documents parsed by parsestring() as well as files that are parsed by parseurl() . The xml parser xtra supports the following character sets: • iso-8859-1 also called latin 1. This is the most common western encoding used on the w...

  • Page 427: Chapter 20

    427 chapter 20 making director movies accessible as a macromedia director mx 2004 author, you might want to provide ways for computer users with disabilities to experience the movies that you create. Director includes accessibility features that let you do this. By using these features, you can make...

  • Page 428

    428 chapter 20: making director movies accessible using the speech xtra the speech xtra adds special methods to scripting that enable the director text-to-speech capability. The text-to-speech behaviors require this xtra extension because they use these script methods. If you write custom text-to-sp...

  • Page 429

    Using the accessibility behavior library 429 enabling keyboard navigation with the accessibility behavior library, you can easily make sprites on the stage navigable with the keyboard. This lets mobility-impaired users select sprites and simulate mouse clicks without using a mouse. For example, if y...

  • Page 430

    430 chapter 20: making director movies accessible 6 in the dialog box that appears, enter a name for the behavior group. Because the accessibility behaviors work together and are dependent on one another, a group name associates all the accessibility behaviors used in a given scene of your movie wit...

  • Page 431

    Using the accessibility behavior library 431 5 repeat this process for each sprite in the scene that you want to be navigable. Note: the accessibility item and accessibility text edit item behaviors cannot be applied to sprites that have the accessibility target or accessibility keyboard controller ...

  • Page 432

    432 chapter 20: making director movies accessible to apply the accessibility speak behavior: 1 begin by applying the keyboard navigation behaviors to sprites in your scene. For more information, see “enabling keyboard navigation” on page 429 . 2 drag the accessibility speak behavior from the library...

  • Page 433

    Using the accessibility behavior library 433 using captioning for users who are hearing impaired, you can add text captioning to your movies. Captioning is the practice of displaying text that corresponds to spoken narration or other sounds being played. Using the captioning behaviors in addition to...

  • Page 434

    434 chapter 20: making director movies accessible 8 in the display how many of the words that follow text box, enter the number of words to display after the word number you selected in the previous step. For example if you want to display 22 words of text after word 16, enter 22 in this text box. 9...

  • Page 435

    Deploying accessible movies 435 to resume the speech: • use the voiceresume() method. To stop speech synthesis: • use the voicestop() method. To check whether the speech is currently speaking, paused, or stopped: • use the voicestate() method. To set the volume of the voice: • use the voicesetvolume...

  • Page 436

    436 chapter 20: making director movies accessible to add the speech xtra to the movie’s xtra extensions list: 1 open the movie. 2 select modify > movie > xtras. 3 in the dialog box that appears, click add. A second dialog box appears. 4 in the alphabetical list of xtra extensions, scroll to speech, ...

  • Page 437: Chapter 21

    437 chapter 21 managing memory macromedia director mx 2004 has effective built-in memory management that is sufficient for most projects. To make memory available for new sprites, director simply unloads the cast members used for sprites that are no longer on the stage. However, sometimes large cast...

  • Page 438

    438 chapter 21: managing memory monitoring memory use the memory inspector displays information about how much memory is available to director for your movie and indicates how much memory different parts of the current movie use and the total disk space the movie occupies. It also can purge all remo...

  • Page 439

    Preloading digital video 439 using script to change a cast member’s purgepriority property is a good technique for controlling memory management. However, changes to the purgepriority property do not take effect until the next time a cast member is used. For example, if you change the property in an...

  • Page 440

    440 chapter 21: managing memory 5 in the frame where you want the video to appear, use script to set the sprite’s loc property to place the sprite on the stage in the location you select. 6 set the movierate property to 1 to start playing the video. This way, the video loads its initial segment into...

  • Page 441: Chapter 22

    441 chapter 22 managing and testing director projects as you work with macromedia director mx 2004 and develop projects with it, you might encounter some situations where a seemingly small change in the design of a project has a significant effect on the organization of the director files and media ...

  • Page 442

    442 chapter 22: managing and testing director projects • organize the cast members in your cast in a logical way. You might choose to group all the cast members of a particular type together, or you might choose to group the cast members from each scene together. Choose a system that works for you a...

  • Page 443

    About testing movies to avoid problems 443 about testing movies to avoid problems while you develop movies, you might encounter some difficulties because creating interesting movies and trying out new ideas always involves some experimentation. By testing your movies according to the simple guidelin...

  • Page 444

    444 chapter 22: managing and testing director projects testing strategies you can use the following strategies to test your movies effectively: • testing in the director authoring environment is different than testing in the director projector and macromedia shockwave environments for online content...

  • Page 445

    Resources 445 3 to specify which frames of your movie are printed, select one of the following frames options: current frame prints the frame that is currently on the stage. Selected frames prints the frames that are selected in the score. All prints all of the frames in your movie. Range prints the...

  • Page 446

    446 chapter 22: managing and testing director projects.

  • Page 447: Chapter 23

    447 chapter 23 packaging movies for distribution when you finish authoring your macromedia director mx 2004 movie, you have a choice of several ways to prepare it for distribution. You can distribute a movie in the macromedia shockwave format that plays in a browser, or you can distribute it as a st...

  • Page 448

    448 chapter 23: packaging movies for distribution for more information about how to distribute xtra extensions with projectors, see technote 13965 in the director support center at www.Macromedia.Com/go/director_support . Although the note might refer to director 7, the information is the same for m...

  • Page 449

    About xtra extensions 449 to preview a movie in a browser: • select file > preview in browser or press f12. About xtra extensions all xtra extensions a movie requires must be installed on your user’s system when the movie runs. When you distribute a movie, you must either include these xtra extensio...

  • Page 450

    450 chapter 23: packaging movies for distribution you can also exclude xtra extensions in projectors. For more information, see “excluding xtra extensions from projectors” on page 462 . Xtra extensions usually required for the movie to play back correctly include the following: • xtra extensions tha...

  • Page 451

    About distribution formats 451 about distribution formats before deciding how to distribute a movie, it helps to understand how director plays movies. Director movies play either with the shockwave player or through a projector player. The shockwave player is a system component that plays movies in ...

  • Page 452

    452 chapter 23: packaging movies for distribution distributing movies on a disk whenever a movie plays from a disk, it accesses all external linked files the same way that it did in the authoring environment. All linked media—bitmaps, sounds, digital videos, and so on—must be in the same relative lo...

  • Page 453

    Changing publish settings 453 if your movie needs xtra extensions that fall beyond the range of the default publish settings, (for example, windows media) you will be prompted to add them. In that case, you can set up your movie with the correct settings by changing them. Changing publish settings y...

  • Page 454

    454 chapter 23: packaging movies for distribution selecting a publishing format use the formats tab to select the movie format you want and determine the types of files you wish to publish. It includes support for creating cross-platform projectors. To set options using the formats tab: • to publish...

  • Page 455

    Changing publish settings 455 setting projector options the projector tab lets you set options that include how the projector movie appears on stage or in a browser, and what type of player it is shown on. To set options using the projector tab: 1 select file > publish settings and click the project...

  • Page 456

    456 chapter 23: packaging movies for distribution setting shockwave options the shockwave tab lets you set options that determine the shockwave player version, how images are compressed, how users interact with the movie once it’s published, and more. To set options using the shockwave tab: 1 select...

  • Page 457

    Changing publish settings 457 3 if you use the default match movie setting in the dimensions field, values in the object and embed tags in the html file are set to the exact dimension of your movie. To change the dimensions, select either pixels or percent of browser window, and type the new dimensi...

  • Page 458

    458 chapter 23: packaging movies for distribution to let users resize the stage without resizing the sprites, select expand stage size. The movie is aligned within the browser based on the align tags that you specify in step 4. 5 to specify align tags for your movie, use the horizontal align and ver...

  • Page 459

    Converting movies created in previous versions of director 459 using dswmedia folders and the support folder to publish shockwave content use a dswmedia folder to obtain data from a local source while a movie is playing in safe player mode. Director treats folders named dswmedia as exceptions to the...

  • Page 460

    460 chapter 23: packaging movies for distribution to be included as a file in a projector, a movie must be created with director 8.5 or newer. However, using lingo, movies created with earlier versions of director can be played (e.G. Go to movie, play movie) back to and including movies created with...

  • Page 461

    Creating projectors 461 4 select from the following options: animate in background lets the movie continue playing if a user switches to another application. This is useful if you want the movie to continue running in the background when its window is not active. If this option is not selected, the ...

  • Page 462

    462 chapter 23: packaging movies for distribution to create a fast-start projector: 1 create a new folder on your computer desktop. It does not matter what you name the folder. 2 in director, select modify > movie > xtras. The movies xtras dialog box appears. 3 select the name of each xtra and desel...

  • Page 463

    About cross-platform projectors 463 • shockwave projectors can use the xtra extensions that have been already installed with shockwave instead of requiring their own copy. • because of the way the xtra extensions list for the movie is maintained, it is possible to get xtra extensions included in a p...

  • Page 464

    464 chapter 23: packaging movies for distribution processing movies with update movies you can use the update movies command on the xtras menu to do the following: • update movies and casts from older version of director to the latest file format. • compress movies for faster downloading from the in...

  • Page 465

    Exporting digital video and frame-by-frame bitmaps 465 6 click update. Director saves new versions of the selected movies with the same names and locations as the original movies. This ensures that all links and references to other files continue to work properly. Director copies the original movies...

  • Page 466

    466 chapter 23: packaging movies for distribution 4 from the format pop-up menu at the bottom of the dialog box, select a format. ■ windows: video for windows (.Avi), dib file sequence (.Bmp), or quicktime movie (.Mov) ■ macintosh: pict or quicktime movie bmp is the standard format for a windows bit...

  • Page 467

    Setting quicktime export options 467 a movie that would work well with tempo settings as the frame rate option is one in which the tempos have been carefully timed. For instance, some frames could be set to a tempo of 10 frames per second, and their quicktime frame durations would be exactly one-ten...

  • Page 468

    468 chapter 23: packaging movies for distribution looped sounds don’t loop in a movie that you have exported as a digital video. To loop a sound in a movie that you plan to export as a digital video, you must trigger the sound by alternating it between the two sound channels. About organizing movie ...

  • Page 469: Chapter 24

    469 chapter 24 using shockwave player macromedia director mx 2004 movies can use the internet in various ways: hosting multiuser sessions such as chats and games, streaming movies and sounds, retrieving data from the network, and interacting with a browser. Whether it is distributed on disk or downl...

  • Page 470

    470 chapter 24: using shockwave player when director streams a movie over the internet, it first downloads the score data and other nonmedia information such as scripts and the size of each cast member’s bounding rectangle. This data is usually quite small compared with the size of the movie’s media...

  • Page 471

    Setting shockwave playback options 471 setting movie playback options to change basic streaming settings for a movie, you use the movie playback properties dialog box. You can turn streaming on and off, specify a number of frames to download before playing the movie, and make director display placeh...

  • Page 472

    472 chapter 24: using shockwave player to set shockwave playback options: 1 select file > publish settings. The publish settings dialog box appears. 2 if not already selected, select shockwave file (dcr) on the formats tab. The shockwave tab appears in the publish settings dialog box. 3 select the s...

  • Page 473

    About streaming with the score and behaviors 473 about streaming with the score and behaviors the easiest way to create a movie that streams well is to arrange the score properly and use behaviors to control the playhead. Director downloads cast members in the order in which they appear in the score...

  • Page 474

    474 chapter 24: using shockwave player checking whether media elements are loaded with lingo or javascript syntax director has several options that let an initial portion of a movie start playing as soon as the required data and cast members are available. You can use lingo or javascript syntax to c...

  • Page 475

    Downloading files from the internet with lingo or javascript syntax 475 to execute a network script operation: 1 start the operation. For example, the following statement initiates a text downloading operation and assigns the network id returned by the getnettext() operation to the variable thenetid...

  • Page 476

    476 chapter 24: using shockwave player the gotonetpage method is similar to the director open method. It does not return a value. To preload a file from the server into the browser’s cache: • use the preloadnetthing() method. For more information about this method, see the scripting reference topics...

  • Page 477

    Using lingo or javascript syntax in different internet environments 477 to determine the state of a network operation that retrieves data: • use the lingo on streamstatus event handler or the javascript streamstatus function. For more information, see the scripting reference topics in the director h...

  • Page 478

    478 chapter 24: using shockwave player the following lingo or javascript syntax supports urls as references to external files. If you use this script in projectors or during authoring, you can avoid pauses while the file is being downloaded by first using preloadnetthing() to download the file. Afte...

  • Page 479

    Testing your movie 479 interacting with browsers you can use setpref() or getpref() to read or write simple text preference files to the prefs folder found in the shockwave player folder. To write to a preferences file on a local disk: • use the setpref method. For more information about this method...

  • Page 480

    480 chapter 24: using shockwave player • run the movie on slow and fast connections; problems can arise from fast as well as slow connections. • check for display problems on systems set to 8-, 16-, 24-, and 32-bit color. Also test as many types of monitors and display adapters as you can. • check f...

  • Page 481: Index

    481 index numerics 3d behaviors about 327 action 330 applying 332 groups 333 library 328 triggers 329 types 328 3d extruder tab (property inspector) 324 3d model tab, property inspector 308 3d text 324 3d vectors 397 3d window, shockwave 306 3d world boxes 330 collision properties and commands 394 d...

  • Page 482

    482 index appearance properties, miaws (movie in a window) 413 arranging sprites 58 ascii values, keys 298 attaching behaviors 275 attributes, xml 424 audio. See sound auto distort command 111 auto filter command 124 automatically adjusting line spacing 168 avi files 465 axis camera rotate tool 306,...

  • Page 483

    Index 483 boxes, text 178 brightness, changing 154 browsers cache, preloading 476 color palettes 155 html file options 456 lingo and javascript support 478 preferences 479 previewing movies 448 shockwave support 447, 448 status area 479 tips for 478 urls, opening 475 brush tool, paint window 104, 10...

  • Page 484

    484 index preferences 36 viewing 26 casts creating 23 defined 22 external 23, 47 internal, defined 23 opening in new window 29 preferences 34 properties 38 centimeters, specifying as unit of measure 168 change cast member action 281 change cursor action 281 change ink action 281 change location acti...

  • Page 485

    Index 485 paste relative command 97 sprites 69 corner points in vector shapes 137 creating 3d text 324 behaviors 279 bitmaps 100 cast members 24 casts 23 custom cast member thumbnails 34 custom tiles 120 editable text 172 external casts 47 fields 172 film loops 94 guides 66 hypertext links 171 libra...

  • Page 486

    486 index protected formats 451 publish command 452 testing 479 urls 451 xtra extensions 449, 450 dithering 114 dockable miaws (movie in a window) 414 docking tool palette 18 dolly camera 330 downloading alternate image options 458 cast members 470 looping behaviors 473 speed 480 status, checking 47...

  • Page 487

    Index 487 downloading, speed 480 importing 42 linking to 44 preloading 476 project management 441 projectors, options 455 types supported 44 url references 478 fill color, paint window 111 fill settings for vector shapes 138 film loops 94, 95 filters, bitmaps 123 finding cast members 40 sprites 57 t...

  • Page 488

    488 index grid configuring 67 positioning sprites 66 properties, setting 18 grouping cast panels 27 groups commands 323 defined 314, 316 methods 364 parameters 333 properties 363 guides color 66 positioning sprites 66 properties, setting 18 guides tab on property inspector 18 h hand tool, paint wind...

  • Page 489

    Index 489 speed 480 streaming movies 470 introduction to director 11 invert colors, paint window 111 italic text 167 j javascript syntax 3d text methods and properties 325 animating sprites 97 assigning cast members to sprites 80 behaviors, writing 281 bitmap controls 114 browser support 478 cast me...

  • Page 490

    490 index model interactions 316 overview 382 properties 383 property inspector 309 text 325 line settings for vector shapes 138 line spacing, adjusting automatically 168 linear tweening option 88 lines, paint window tools 105 lingo syntax 3d text methods and properties 325 animating sprites 97 assi...

  • Page 491

    Index 491 sounds, importing 231 textures 360 unloading cast members 47, 437, 439 xtra extensions 449 memory inspector 438 mesh deform modifier 380 mesh generator 339, 342 messages, sending to sprites 287 methods activex 205 bones player 373 cameras 390, 396 collision 395 downloading files 475 event ...

  • Page 492

    492 index movies accessibility 427, 428 browsers, playing in 478 browsers, previewing in 448 captioning 433 changing color depth of 147 color modes 146 color palettes, changing 149 cursors, animated color 301 disks 452 distribution formats 451 examples of 12 exporting as digital video 465 exporting ...

  • Page 493

    Index 493 o object-relative model movement 351 objects 3d 315 flash 193 local connection 195 miaws (movie in a window) 410 renderer services 403 scripts 393 vector 397 offscreen graphics buffer 308 old versions converting movies 459 opening movies 28 update movies command 464 on getpropertydescripti...

  • Page 494

    494 index play cast member action 281 play done method 294 play every frame digital video property 246 play external file action 281 play method 294 playback options, shockwave 471 playhead behaviors 473 jumping behaviors 473 markers 330 sprites, extending 70 playing dvd-video 12 playing flash movie...

  • Page 495

    Index 495 guides tab 66 guides tab, stage 18 member tab 22, 39 miaws (movie in a window) 415 movie tab 146 new features 304 sprites 59 stage 18 text tab 324 protected movies 451 public actions 330 public behaviors 328 publish settings changing 453 default 452 files tab 455 formats tab 454 html 456 i...

  • Page 496

    496 index preferences 20 searching for cast members in 41 sound controls 233 space to time command 93 sprite display settings 20 sprite labels 62 sprites, viewing by name 56 streaming movies, behavior 473 tempo 157 windows, using multiple 19 screen resolution for graphics 100 script window, creating...

  • Page 497

    Index 497 controlling with lingo or javascript 239 importing 231 lingo and javascript controls 235 looping 234 playing external 239 shockwave audio 237 streaming shockwave audio 238 streaming, formats supported 232 synchronizing with cue points 240, 259 transitions, playing during 161 windows issues...

  • Page 498

    498 index guides and grid 18 moving sprites 69 positioning sprites 65 property inspector 18 rendering methods 309 sprite overlay 61 sprite preference 52 sprites, viewing by name 56 standard import option 43 step recording 96 storyboard format 445 streaming controlling with lingo or javascript 474 fl...

  • Page 499

    Index 499 transparent ink 79 trigger behaviors defined 328 groups 333 parameters 333 viewing 328 troubleshooting color palettes 154 resources 445 testing movies 443 truncate sprites being pasted option 21 tunnel depth 325 tweak window 66 tweening bitmap filters 124 defined 83 paths 84 properties 84 ...

  • Page 500

    500 index workspace customizing 12 world-relative model movement 351 wrapping, text 178 x xml about 419 attributes 424 character sets 425 data, sending from flash to director 193 nodes 422, 424 parser objects 420, 424 websites, resources 420 white space, ignoring 425 xtra extensions 3d 305 auto filt...