Académique Documents
Professionnel Documents
Culture Documents
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 Parent Script
pecial scripts used to create child objects Used in OOP (advanced level of Lingo)
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