
277
getVariable()
Syntax
sprite(
flashSpriteNum
).getVariable("
variableName
" {,
returnValueOrReference
})
getVariable(sprite
flashSpriteNum
, "
variableName
" {,
returnValueOrReference
})
Description
Function; returns the current value of the given variable from the specified Flash sprite. Flash
variables were introduced in Flash version 4.
This function can be used in two ways.
Setting the optional
returnValueOrReference
parameter to
TRUE
(the default) returns the
current value of the variable as a string. Setting the
returnValueOrReference
parameter to
FALSE
returns the current literal value of the Flash variable.
If the value of the Flash variable is an object reference, you must set the
returnValueOrReference
parameter to
FALSE
in order for the returned value to have meaning
as an object reference. If it is returned as a string, the string will not be a valid object reference.
Examples
This statement sets the variable
tValue
to the string value of the Flash variable named
gOtherVar
in the Flash movie in sprite 3:
tValue = sprite(3).getVariable("gOtherVar",TRUE)
put tValue
-- "5"
This statement sets the variable
tObject
to refer to the same object that the variable named
gVar
refers to in the Flash movie in sprite 3:
tObject = sprite(3).getVariable("gVar",FALSE)
This statement returns the value of the variable
currentURL
from the Flash cast member in sprite
3 and displays it in the Message window:
put getVariable(sprite 3, "currentURL")
-- "http://www.macromedia.com/software/flash/"
See also
setVariable()
getWorldTransform()
Syntax
member(
whichCastmember
).node(
whichNode
).getWorldTransform()
member(
whichCastmember
).node(
whichNode
).getWorldTransform().\
position
member(
whichCastmember
).node(
whichNode
).getWorldTransform().\
rotation
member(
whichCastmember
).node(
whichNode
).getWorldTransform().scale
Description
3D command; returns the world-relative transform of the model, group, camera, or light
represented by
node
.
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...