stageTop
549
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.
Parameters
pointOnDirectorStage
Required. Specifies the point on the Director stage.
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.
-- Lingo syntax
on checkFlashRollover
if sprite(5).stageToFlash(point(_mouse.mouseH,_mouse.mouseV)) =
point(130,10) then
sprite(5).stop()
end if
end
// JavaScript syntax
function checkFlashRollover() {
var stf = sprite(5).stageToFlash(point(_mouse.mouseH,_mouse.mouseV));
if (stf = point(130,10)) {
sprite(5).stop();
}
}
See also
flashToStage()
stageTop
Usage
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.
When the movie plays back as an applet, the
stageTop
property is always 0, which is the location
of the left side of the applet.
This function can be tested but not set.
Sprite coordinates are expressed relative to the upper left corner of the Stage.
Содержание DIRECTOR MX 2004-DIRECTOR SCRIPTING
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...