newCamera
419
The following statements create two child objects called myBird1 and myBird2. They are given
different starting speeds: 15 and 25, respectively. When the fly handler is called for each child
object, the speed of the object is displayed in the Message window.
myBird1 = script("Bird").new(15)
myBird2 = script("Bird").new(25)
myBird1.fly()
myBird2.fly()
This message appears in the Message window:
-- "I am flying at 15 mph"
-- "I am flying at 25 mph"
This statement creates a new timeout object called intervalTimer that will send a timeout event to
the
on minuteBeep
handler in the child object playerOne every 60 seconds:
timeout("intervalTimer").new(60000, #minuteBeep, playerOne)
This statement creates a sample JavaScript function:
function sampleTimeout () { trace("hello"); }
Elsewhere in your movie you can use this statement to create a timeout object that calls the
JavaScript function:
-- Lingo syntax
gTO = timeout().new("test",50,"sampleTimeout",0)
// JavaScript syntax
_global.gTO = new timeout("test",50,"sampleTimeout",0)
See also
on stepFrame
,
actorList
,
ancestor
,
me
,
type (Member)
,
timeout()
newCamera
Usage
member(
whichCastmember
).newCamera(
newCameraName
)
Description
3D command; creates a new camera within a cast member.
Parameters
newCameraName
Required. Specifies the name of the new camera. The name of the new camera
must be unique within the cast member.
Example
This statement creates a new camera called in-car camera:
member("3D World").newCamera("in-car camera")
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...