Writing Scripts In The Script Window - MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference

Director scripting reference
Table of Contents

Advertisement

You can also add properties to object instances after the instances have been created. When you
add a property to a specific object instance, that property is available only to that specific object
instance. Using the
property to
color
trace(myCar.color); // returns undefined
myCar.color = "blue"; // add the color property to the myCar instance
trace(myCar.color); // returns "blue"
var secondCar = new Car("Honda", "Accord"); // create a second object instance
trace(secondCar.color); // returns undefined

Writing scripts in the Script window

When you write scripts for a movie, the quantity and variety of scripts can be very large. Deciding
which methods or properties to use, how to structure scripts effectively, and where scripts should
be placed requires careful planning and testing, especially as the complexity of your movie grows.
Before you begin writing scripts, formulate your goal and understand what you want to
achieve. This is as important—and typically as time-consuming—as developing storyboards
for your work.
When you have an overall plan for the movie, you are ready to start writing and testing scripts.
Expect this to take time. Getting scripts to work the way you want often takes more than one
cycle of writing, testing, and debugging.
The best approach is to start simple and test your work frequently. When you get one part of a
script working, start writing the next part. This approach helps you identify bugs efficiently and
ensures that your scripts are solid as they become more complex.
When you write your scripts, you write them in the Script window in the Director user interface.
The Script window provides a number of features that help you create and modify your scripts.
To open the Script window, do one of the following:
Select Window > Script.
Double-click a script cast member in the Cast window.
For information on alternative ways to create and open scripts, see
on page
79.
object instance created previously, the following statements add the
myCar
after it has already been created.
myCar
"Performing common tasks"
Writing scripts in the Script window
73

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Director mx 2004

Table of Contents