Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 35

Macromedia Director MX 2004 - Design Professional

ATTACHING BEHAVIORS

Chapter Lessons
Attach built-in behaviors Create a behavior Add and modify a behavior Open a movie with a behavior

Attaching Behaviors

Chapter J

Chapter Lessons
Create a dropdown list with a behavior Add keyboard navigation with a behavior Change text to speech with a behavior Insert and modify a Flash component
Attaching Behaviors Chapter J 3

Attaching Behaviors
A behavior is a prewritten script that adds interactivity to a movie Can use built-in behaviors or create your own You do not have to write or understand Lingo or JavaScript syntax to create behaviors
Attaching Behaviors Chapter J 4

Attaching Behaviors
Built-in behaviors are grouped by category
Components 3D Accessibility Animation Controls Internet Media Navigation Paintbox Text
Chapter J 5

Attaching Behaviors

Attaching Behaviors
Components library allows you to insert Flash components Behaviors in 3D library perform actions on 3D objects based on triggers Accessibility library makes movies accessible for hearing- and visually-impaired Animation library makes sprites move with or without user input Controls library allows you to create and control user interface elements
Attaching Behaviors Chapter J 6

Attaching Behaviors
Internet library controls activities on the Web Media library controls playback for Flash, QuickTime, RealMedia, and Sound media Navigation library allows you to control movement and location of playback head Paintbox library allows you to create and modify bitmap images Text library allows you to format numbers, force uppercase or lowercase characters, and create hypertext
Attaching Behaviors Chapter J 7

Attach Built-In Behaviors


Can drag behaviors onto frames and sprites in Score and on Stage with Library palette Can attach same behavior to multiple sprites and frames If you want a behavior to affect a cast member, drag behavior to associated sprite If you want a behavior to affect entire movie, attach behavior to a frame
Attaching Behaviors Chapter J

Attach Built In Behaviors


You can modify the original behaviors in the Library palette; the scripts are located in a cast file within the Macromedia Director MX 2004 folder When you attach a behavior, a Parameters dialog box might open, asking for specific settings Can only attach one behavior to a frame Can use Behavior Inspector or Behavior tab in Property inspector to view, add, modify, and remove attached behaviors
Attaching Behaviors Chapter J 9

Attach Built In Behaviors

Attaching Behaviors

Chapter J

10

Create a Behavior
Can use Behavior inspector to create simple behaviors Must understand and write Lingo scripts to create complex behaviors Behaviors perform two functions:
Detect a specified event Perform one or more actions in response
Attaching Behaviors Chapter J 11

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

Attaching Behaviors

Chapter J

12

Add and Modify a Behavior


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

Attaching Behaviors

Chapter J

13

Modifying a Behavior
Use behavior Inspector to modify a behavior To modify a behavior throughout entire movie, double-click behavior in Cast window to open Behavior Inspector and make changes To modify a behavior for a specific sprite, select sprite in Score or on Stage, open Behavior Inspector, select behavior, and make changes
Attaching Behaviors Chapter J 14

Modifying a Behavior
In Behavior Inspector, you can add events and actions to an existing behavior Cannot directly modify existing events and actions associated with a behavior Remove events and actions you want to change from the editing panes and create new ones Can also use Behavior tab to make make changes
Attaching Behaviors Chapter J 15

Behavior Inspector
Restore Cursor behavior

Behavior event

Behavior action

Attaching Behaviors

Chapter J

16

Open a Movie with a Behavior


Can open a movie from within a movie This technique closes current movie and opens another Allows you to organize large sections of a movie into smaller separate movies - requires less RAM
Attaching Behaviors Chapter J 17

Open a Movie with a Behavior


Can create movie modules (independent movies) simultaneously to save time and maximize production effort Must store movie modules in same location to play and package the movie Can use a behavior in Library palette to open a movie module
Attaching Behaviors Chapter J 18

Create a Dropdown List with a Behavior


Library palette includes a behavior to create a dropdown list from a field text box To 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
Attaching Behaviors Chapter J 19

Using a Dropdown List during a Movie


Can use dropdown list to allow users to make selections or perform simple commands Dropdown list opens and reveals all items when user clicks it List remains open until next click List closes after user makes selection
Attaching Behaviors Chapter J 20

Using a Dropdown List during a Movie


Enter name of list here Current check mark indicator for dropdown list

Attaching Behaviors

Chapter J

21

Add Keyboard Navigation with a Behavior


Making a Movie Accessible Enabling Keyboard Navigation Setting Up Keyboard Navigation

Attaching Behaviors

Chapter J

22

Making a Movie Accessible


Director includes several behaviors for accessibility features:
Keyboard navigation Text-to-speech Captioning

Make movies more accessible to hearingand visually-impaired users Behaviors are available on Library palette
Attaching Behaviors Chapter J 23

Making a Movie Accessible

Attaching Behaviors

Chapter J

24

Enabling Keyboard Navigation


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

Enabling Keyboard Navigation


Keyboard Navigation Options
key(s) [Tab] [Shit][Tab] [Ctrl][Page Up] (Win) [control][page up] (Mac) description Go to the next item on the Stage Go to the previous item on the Stage Go to the first item on the Stage

[Ctrl][Page Down] (Win) Go to the last item on the Stage [control][page down] (Mac) [Enter] (Win) [return] (Mac)
Attaching Behaviors

Trigger the item; same as clicking the sprite


Chapter J 26

Setting Up Keyboard Navigation


Most accessibility behaviors must be used with other accessibility behaviors Must use Accessibility Target, Accessibility Keyboard Controller, Accessibility Item or Accessibility Text Edit Item, and Accessibility Group Order behaviors together to enable keyboard navigation
Attaching Behaviors Chapter J 27

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 behavior 3. 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

Attaching Behaviors

Chapter J

28

Setting Up Keyboard Navigation

Attaching Behaviors

Chapter J

29

Change Text to Speech with a Behavior


Can use Accessibility behaviors to help visually-impaired users Use text-to-speech behaviors to make a text cast member or text in a selected sprite audible Designed to be used with keyboard navigation behaviors
Attaching Behaviors Chapter J 30

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-tospeech feature on or off
Attaching Behaviors Chapter J 31

Insert and Modify a Flash Component


Access built-in Flash components on the Library palette or the Tools palette Each 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.

Attaching Behaviors

Chapter J

32

Insert and Modify a Flash Component


Button Flash component

Flash component settings

Flash components

Attaching Behaviors

Chapter J

33

Chapter J Summary
Attach built-in behaviors Create a behavior Add and modify a behavior Open a movie with a behavior Create a dropdown list with a behavior
Attaching Behaviors

Chapter J

34

Chapter J Summary
Add keyboard navigation with a behavior Change text to speech with a behavior Insert and modify a Flash component

Attaching Behaviors

Chapter J

35

You might also like