486
This handler moves a named sprite to the location that the user clicks:
end mouseDown
on mouseDown
-- Set these variables as needed for your own movie
theSprite = 1 -- Set the sprite that should move
steps = 40 -- Set the number of steps to get there
initialLoc = sprite(theSprite).loc
delta = (the clickLoc - initialLoc) / steps
repeat with i = 1 to steps
sprite(theSprite).loc = init (i * delta)
updateStage
end repeat
end mouseDown
See also
mouseLoc
,
flashToStage()
,
rect()
,
stageToFlash()
pointAt
Syntax
member(
whichCastmember
).model(
whichModel
).pointAt\
(
vectorPosition
{,
vectorUp
})
member(
whichCastmember
).camera(
whichCamera
).pointAt\
(
vectorPosition
{,
vectorUp
})
member(
whichCastmember
).light(
whichLight
).pointAt\
(
vectorPosition
{,
vectorUp
})
member(
whichCastmember
).group(
whichGroup
).pointAt\
(
vectorPosition
{,
vectorUp
})
Description
3D command; rotates the referenced object so that its forward direction vector points at the world
relative position specified by
vectorPosition
, then it rotates the referenced object to point it’s up
direction vector in the direction hinted at by the world relative vector specified by
vectorUp
. The
value of
vectorPostion
can also be a node reference.
The optional parameter
vectorUp
is a world relative vector that hints at where the object’s up
vector should point. If this parameter isn’t specified, then this command defaults to using the
world’s y axis as the up hinting vector. If you attempt to point the object at a position such that
the object’s forward vector is parallel to the world’s y axis, then the world’s x axis is used as the up
hinting vector.
The direction at which you wish to point the object’s forward direction and the direction
specified by
vectorUp
do not need to be perpendicular to each other being as this command only
uses the
vectorUp
parameter as a hinting vector.
The object’s front and up direction vectors are defined by the object’s
pointAtOrientation
property.
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...