User Guide

624
Sprite coordinates are expressed relative to the upper left corner of the Stage.
Example
These two statements position sprite 3 a distance of 50 pixels from the right edge of the Stage:
stageWidth = the stageRight - the stageLeft
sprite(3).locH = stageWidth - 50
See also
stageLeft, stageBottom, stageTop, locH, locV
stageToFlash()
Syntax
sprite(whichFlashSprite).stageToFlash(pointOnDirectorStage)
stageToFlash (sprite whichFlashSprite, pointOnDirectorStage)
Description
Function; returns the coordinate in a Flash movie sprite that corresponds to a specified coordinate
on the Director Stage. The function both accepts the Director Stage coordinate and returns the
Flash movie coordinate as Director point values: for example, point (300,300).
Flash movie coordinates are measured in Flash movie pixels, which are determined by the original
size of the movie when it was created in Flash. Point (0,0) of a Flash movie is always at its upper
left corner. (The cast member’s
originPoint property is not used to calculate movie coordinates; it
is used only for rotation and scaling.)
The
stageToFlash() function and the corresponding flashToStage() function are helpful for
determining which Flash movie coordinate is directly over a Director Stage coordinate. For both
Flash and Director, point (0,0) is the upper left corner of the Flash Stage or Director Stage. These
coordinates may not match on the Director Stage if a Flash sprite is stretched, scaled, or rotated.
Example
The following handler checks to see if the mouse pointer (whose location is tracked in Director
Stage coordinates) is over a specific coordinate (130,10) in a Flash movie sprite in channel 5. If
the pointer is over that Flash movie coordinate, the script stops the Flash movie.
on checkFlashRollover
if sprite(5).stageToFlash(point(the mouseH,the mouseV)) = point(130,10) then
sprite(5).stop()
end if
end
See also
flashToStage()
stageTop
Syntax
the stageTop
Description
Function; along with stageBottom, stageLeft, and stageRight, indicates where the Stage is
positioned on the desktop. It returns the top vertical coordinate of the Stage relative to the upper
left corner of the main screen’s desktop. If the Stage is in the upper left corner of the main screen,
this coordinate is 0.