MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference page 208

Director scripting reference
Table of Contents

Advertisement

The term
field
compatibility. For new movies, use
Example
This statement places the characters 5 through 10 of the field name entry in the variable
:
myKeyword
myKeyword = field("entry").char[5..10]
This statement checks whether the user entered the word desk and, if so, goes to the frame
:
deskBid
if member("bid") contains "desk" then _movie.go("deskBid")
See also
char...of, item...of, line...of,
global
Usage
global variable1 {, variable2} {, variable3}...
Description
Keyword; defines a variable as a global variable so that other handlers or movies can share it.
Every handler that examines or changes the content of a global variable must use the
keyword to identify the variable as global. Otherwise, the handler treats the variable as a local
variable, even if it is declared to be global in another handler.
Note: To ensure that global variables are available throughout a movie, declare and initialize them in
the
prepareMovie
variables will be reset to the initial values unless you first check to see that they aren't already set.
A global variable can be declared in any handler or script. Its value can be used by any other
handlers or scripts that also declare the variable as global. If the script changes the variable's value,
the new value is available to every other handler that treats the variable as global.
A global variable is available in any script or movie, regardless of where it is first declared; it is not
automatically cleared when you navigate to another frame, movie, or window.
Any variables manipulated in the Message window are automatically global, even though they are
not explicitly declared as such.
Movies with Macromedia Shockwave content playing on the Internet cannot access global
variables within other movies, even movies playing on the same HTML page. The only way
movies can share global variables is if an embedded movie navigates to another movie and replaces
itself through either
Example
The following example sets the global variable StartingPoint to an initial value of 1 if it doesn't
already contain a value. This allows navigation to and from the movie without loss of stored data.
global gStartingPoint
on prepareMovie
if voidP(gStartingPoint) then gStartingPoint = 1
end
208
Chapter 11: Keywords
was used in earlier versions of Director and is maintained for backward
member
handler. Then, if you leave and return to the movie from another movie, your global
or
goToNetMovie
to refer to field cast members.
word...of
.
go movie
global

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Director mx 2004

Table of Contents