Vous êtes sur la page 1sur 7

Part I Understanding Lingo

Lingo is the real mechanism of multimedia authoring, without which a multimedia application may not have any genuine enhancement in term of interactivity and navigation. Although Director provides various predefined behaviors and scripts for immediate use, a customized behaviors and scripts offer unlimited possibilities to the developer. Lingo is a very easy scripting language and easy to adapt to, even for users with non-programming background. There are FOUR (4) types of Lingo scripts that handles different functions and is stored differently: o Movie script Contains user-defined handlers and functions Used to define and initialize global variables Can have more than 1 movie scripts per movie A behavior script is either attached to sprites or frame in the score A sprite may have more than one behavior (scripts) attached to it A frame may have only one script attached A behavior is triggered on an event/occurrence such as mouse clicks, mouse movements, end of frame and sound stop o Cast member Script Attached to the Cast Member in the Cast Window. May have only one Behavior attached to a cast member

o Behaviors Score / Frame script / Sprite script

o Parent Script

pecial scripts used to create child objects Used in OOP (advanced level of Lingo)

Part II Message Hierarchy


A message is a signal sent by an event such as mouseUp, mouseDown, etc. Macromedia Director check for scripts that handles the message, called handlers The Handler corresponds to the message; for example the on mouseUp handler will handle the mouseUp message. Director follows a hierarchy in determining which handler to be executed when an event occurs. When the correct handler is determined, it will be executed. The hierarchy works as follows : A message is first sent to the sprite associated with the event If the sprite has no behavior (sprite script) handling the message, the message is sent to the cast member. If the cast script does not have a handler for the message, the message is sent to the frame script. If the frame script also does not have a handler, the message is sent to the movie script. If there is still no handler found, the message is not used. Refer to Figure 7.1 that illustrate the sequences.

Part III Handlers


A handler is a way of grouping together several Lingo statements to perform a single task. Lingo has both user-defined handlers and built-in handlers. These handlers can reside in various kinds of Lingo scripts but is usually stored in a Movie script. A handler is invoked by calling its name. Figure 7.2 is an example of a typical handler in Lingo (i.e. The command to call the handler below is : Resize)

D.I.Y
1. Create a simple graphic with the paint window and name it Sprite 1. 2. Drag Sprite 1 onto the Stage (in channel 1 in the Score) 3. Click the Script Window Icon (Ctrl-0) and name the movie script ResizeSprite. 4. Type in all the code as in Figure 7.2. 5. Create a push button with the label Resize Now 6. Create a new cast script ResizeMe and type in the following code on mouseDown Resize end mouseDown 7. Drag the Script you just created onto the button. 8. Play the movie and click on the button. Observe that the sprite on the stage will be resized accordingly.

Part IV Behaviors
A behavior is a pre-written Lingo script that makes it easy to add interactivity to a movie. Director provides a Library palette with over 100 built-in behaviors that you can drag and drop onto sprites and frames in the Score window and on the Stage. If you are not sure where to find a behavior to perform a certain type of action, see below for a list of actions you can perform with the behavior categories. o Animation Make sprites move, change color and size Add user interface elements or provide tool tips that appear when the pointer rolls over a sprite o Internet Control internet forms, let 2 or more users simultaneously chat and modify a bitmap image, and control movie for optimal streaming o Media Control Flash, QuickTime and sound media Move the playback head, open new movies, pause the movie, and make the playback head return to previous location o Paintbox o Text Let the user create and modify bitmap images, using Directors built-in drawing tools o Jump behaviors under Controls and Navigation o Controls

Control and format text, such as clock timers and calendars.

Part V - IMPORTING SOUND/VIDEO


Give your movie added appeal by including a soundtrack, a voice-over, ambient noises, or other sounds. Adding digital video to your movie creates even more interest. o Digital video not only offers high-quality real-time image animation and sound but also supports new types of media such as QuickTime VR panoramas, and DVDs. Through Lingo, you have control over when sounds start and stop, how long they last, their quality and volume, and a number of other effects. Using Shockwave Audio, you can compress sounds for easier distribution and stream them from an Internet source. Director imports video files in QuickTime, RealMedia, Windows Media, and AVI formats. Director MX 2004 allows us to pull video directly from a DVD disc into our movie. Directors media synchronization features let you synchronize events in a movie to precise cue points embedded in sound and digital video. Sound and video make significant demands on a computers processing power, so you may need to manage them carefully to make sure they do not adversely affect your movies performance.

Vous aimerez peut-être aussi