35
ATTACHING BEHAVIORS Macromedia Director MX 2004 - Design Professional

20080912120912 chapter j

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: 20080912120912 chapter j

ATTACHING BEHAVIORS

Macromedia Director MX2004 - Design Professional

Page 2: 20080912120912 chapter j

2Attaching Behaviors Chapter J

Attach built-in behaviorsCreate a behaviorAdd and modify a behaviorOpen a movie with a behavior

Chapter Lessons

Page 3: 20080912120912 chapter j

3Attaching Behaviors Chapter J

Create a dropdown list with a behaviorAdd keyboard navigation with a behaviorChange text to speech with a behaviorInsert and modify a Flash component

Chapter Lessons

Page 4: 20080912120912 chapter j

4Attaching Behaviors Chapter J

A behavior is a prewritten script that adds interactivity to a movieCan use built-in behaviors or create your ownYou do not have to write or understand Lingo or JavaScript syntax to create behaviors

Attaching Behaviors

Page 5: 20080912120912 chapter j

5Attaching Behaviors Chapter J

Built-in behaviors are grouped by category– Components – 3D– Accessibility– Animation– Controls– Internet– Media– Navigation– Paintbox– Text

Attaching Behaviors

Page 6: 20080912120912 chapter j

6Attaching Behaviors Chapter J

Components library allows you to insert Flash componentsBehaviors in 3D library perform actions on 3D objects based on triggersAccessibility library makes movies accessible for hearing- and visually-impairedAnimation library makes sprites move with or without user inputControls library allows you to create and control user interface elements

Attaching Behaviors

Page 7: 20080912120912 chapter j

7Attaching Behaviors Chapter J

Internet library controls activities on the WebMedia library controls playback for Flash, QuickTime, RealMedia, and Sound mediaNavigation library allows you to control movement and location of playback headPaintbox library allows you to create and modify bitmap imagesText library allows you to format numbers, force uppercase or lowercase characters, and create hypertext

Attaching Behaviors

Page 8: 20080912120912 chapter j

8Attaching Behaviors Chapter J

Attach Built-In BehaviorsCan drag behaviors onto frames and sprites in Score and on Stage with Library paletteCan attach same behavior to multiple sprites and framesIf you want a behavior to affect a cast member, drag behavior to associated spriteIf you want a behavior to affect entire movie, attach behavior to a frame

Page 9: 20080912120912 chapter j

9Attaching Behaviors Chapter J

Attach Built In BehaviorsYou can modify the original behaviors in the Library palette; the scripts are located in a cast file within the Macromedia Director MX 2004 folderWhen you attach a behavior, a Parameters dialog box might open, asking for specific settingsCan only attach one behavior to a frameCan use Behavior Inspector or Behavior tab in Property inspector to view, add, modify, and remove attached behaviors

Page 10: 20080912120912 chapter j

10Attaching Behaviors Chapter J

Attach Built In Behaviors

Page 11: 20080912120912 chapter j

11Attaching Behaviors Chapter J

Create a BehaviorCan use Behavior inspector to create simple behaviorsMust understand and write Lingo scripts to create complex behaviorsBehaviors perform two functions:– Detect a specified event– Perform one or more actions in

response

Page 12: 20080912120912 chapter j

12Attaching Behaviors Chapter J

Create a BehaviorBehavior inspector lists most common events and actions used in behaviors

Page 13: 20080912120912 chapter j

13Attaching Behaviors Chapter J

Add and Modify a Behavior

Sometimes necessary to create a set of behaviors to complete a single operationFor example, Change Cursor and Restore Cursor behaviors are often used togetherCan use the Behavior Inspector tab in Property inspector to add behaviors

Page 14: 20080912120912 chapter j

14Attaching Behaviors Chapter J

Modifying a Behavior

Use behavior Inspector to modify a behaviorTo modify a behavior throughout entire movie, double-click behavior in Cast window to open Behavior Inspector and make changesTo modify a behavior for a specific sprite, select sprite in Score or on Stage, open Behavior Inspector, select behavior, and make changes

Page 15: 20080912120912 chapter j

15Attaching Behaviors Chapter J

Modifying a BehaviorIn Behavior Inspector, you can add events and actions to an existing behaviorCannot directly modify existing events and actions associated with a behaviorRemove events and actions you want to change from the editing panes and create new onesCan also use Behavior tab to make make changes

Page 16: 20080912120912 chapter j

16Attaching Behaviors Chapter J

Behavior InspectorRestore Cursor

behavior

Behavior action

Behavior event

Page 17: 20080912120912 chapter j

17Attaching Behaviors Chapter J

Open a Movie with a Behavior

Can open a movie from within a movieThis technique closes current movie and opens anotherAllows you to organize large sections of a movie into smaller separate movies - requires less RAM

Page 18: 20080912120912 chapter j

18Attaching Behaviors Chapter J

Open a Movie with a BehaviorCan create movie modules (independent movies) simultaneously to save time and maximize production effortMust store movie modules in same location to play and package the movieCan use a behavior in Library palette to open a movie module

Page 19: 20080912120912 chapter j

19Attaching Behaviors Chapter J

Create a Dropdown List with a Behavior

Library palette includes a behavior to create a dropdown list from a field text boxTo create a dropdown list, create a filed sprite on Stage, enter text for list items, drag Dropdown List behavior from Library palette onto the field sprite

Page 20: 20080912120912 chapter j

20Attaching Behaviors Chapter J

Using a Dropdown List during a Movie

Can use dropdown list to allow users to make selections or perform simple commandsDropdown list opens and reveals all items when user clicks itList remains open until next clickList closes after user makes selection

Page 21: 20080912120912 chapter j

21Attaching Behaviors Chapter J

Using a Dropdown List during a Movie

Enter name of list here

Current check mark indicator for

dropdown list

Page 22: 20080912120912 chapter j

22Attaching Behaviors Chapter J

Add Keyboard Navigation with a Behavior

Making a Movie AccessibleEnabling Keyboard NavigationSetting Up Keyboard Navigation

Page 23: 20080912120912 chapter j

23Attaching Behaviors Chapter J

Making a Movie Accessible

Director includes several behaviors for accessibility features:

– Keyboard navigation– Text-to-speech– Captioning

Make movies more accessible to hearing- and visually-impaired usersBehaviors are available on Library palette

Page 24: 20080912120912 chapter j

24Attaching Behaviors Chapter J

Making a Movie Accessible

Page 25: 20080912120912 chapter j

25Attaching Behaviors Chapter J

Enabling Keyboard Navigation

Keyboard navigation behaviors let mobility-impaired users select sprites and simulate mouse clicks without using a mouseUsers select items using Tab key, which highlights item with a colored rectangle, or focus ring

Page 26: 20080912120912 chapter j

26Attaching Behaviors Chapter J

Enabling Keyboard Navigation

Keyboard Navigation Optionskey(s) description[Tab] Go to the next item on the Stage[Shit][Tab] Go to the previous item on the Stage

[Ctrl][Page Up] (Win)[control][page up] (Mac)

Go to the first item on the Stage

[Ctrl][Page Down] (Win)[control][page down] (Mac)

Go to the last item on the Stage

[Enter] (Win) [return] (Mac)

Trigger the item; same as clicking the sprite

Page 27: 20080912120912 chapter j

27Attaching Behaviors Chapter J

Setting Up Keyboard Navigation

Most accessibility behaviors must be used with other accessibility behaviorsMust use Accessibility Target, Accessibility Keyboard Controller, Accessibility Item or Accessibility Text Edit Item, and Accessibility Group Order behaviors together to enable keyboard navigation

Page 28: 20080912120912 chapter j

28Attaching Behaviors Chapter J

Setting Up Keyboard Navigation

Steps:1. Create an Accessibility group, which associates all

accessibility behaviors within the group with a specific scene (Use different group name in different scene)

2. Use Accessibility Keyboard Controller behavior3. Attach Accessibility Item behavior to sprite or sprites

or attach Accessibility Text Edit Item behavior to text sprite

4. Attach Accessibility Group Order behavior to sprites that have Accessibility Item or Accessibility Text Edit Item behaviors

Page 29: 20080912120912 chapter j

29Attaching Behaviors Chapter J

Setting Up Keyboard Navigation

Page 30: 20080912120912 chapter j

30Attaching Behaviors Chapter J

Change Text to Speech with a Behavior

Can use Accessibility behaviors to help visually-impaired usersUse text-to-speech behaviors to make a text cast member or text in a selected sprite audibleDesigned to be used with keyboard navigation behaviors

Page 31: 20080912120912 chapter j

31Attaching Behaviors Chapter J

Change Text to Speech with a Behavior

Director has three text-to-speech behaviors:

– Accessibility Speak lets you specify text to be spoken when user navigates to a sprite with Tab key

– Accessibility Speak Member Text lets you specify a text cast member to be spoken when user navigates to a sprite with the Tab key

– Accessibility Speak Enable/Disable lets you specify a user even that can turn the text-to-speech feature on or off

Page 32: 20080912120912 chapter j

32Attaching Behaviors Chapter J

Insert and Modify a Flash Component

Access built-in Flash components on the Library palette or the Tools paletteEach component has unique parameters that you can set to change its appearance and behavior in the Property inspector or a script using Lingo or JavaScript syntax.

Page 33: 20080912120912 chapter j

33Attaching Behaviors Chapter J

Insert and Modify a Flash Component

Button Flash component

Flash components

Flash component settings

Page 34: 20080912120912 chapter j

34Attaching Behaviors Chapter J

Chapter J Summary

Attach built-in behaviorsCreate a behaviorAdd and modify a behaviorOpen a movie with a behaviorCreate a dropdown list with a behavior

Page 35: 20080912120912 chapter j

35Attaching Behaviors Chapter J

Chapter J Summary

Add keyboard navigation with a behaviorChange text to speech with a behaviorInsert and modify a Flash component