![MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference Download Page 316](http://html1.mh-extra.com/html/macromedia/director-mx-2004-director-scripting/director-mx-2004-director-scripting_reference_3321720316.webp)
316
Chapter 12: Methods
flashToStage()
Usage
-- Lingo syntax
spriteObjRef
.flashToStage(
pointInFlashMovie
)
// JavaScript syntax
spriteObjRef
.flashToStage(
pointInFlashMovie
);
Description
Function; returns the coordinate on the Director Stage that corresponds to a specified coordinate
in a Flash movie sprite. The function accepts both the Flash channel and movie coordinate and
returns the Director Stage coordinate as Director point values: for example, point(300,300).
Flash movie coordinates are measured in Flash movie pixels, which are determined by a movie’s
original size when it was created in Flash. For the purpose of calculating Flash movie coordinates,
point(0,0) of a Flash movie is always at its upper left corner. (The cast member’s
originPoint
property is used only for rotation and scaling, not to calculate movie coordinates.)
The
flashToStage
and the corresponding
stageToFlash
functions 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
pointInFlashMovie
Required. The point in the Flash movie sprite whose coordinates
are returned.
Example
This handler accepts a point value and a sprite reference as a parameter, and it then sets the
upper left coordinate of the specified sprite to the specified point within a Flash movie sprite in
channel 10:
-- Lingo syntax
on snapSprite(whichFlashPoint, whichSprite)
sprite(whichSprite).loc = sprite(1).FlashToStage(whichFlashPoint)
_movie.updatestage()
end
// JavaScript syntax
function snapSprite(whichFlashPoint, whichSprite) {
sprite(whichSprite).loc = sprite(1).FlashToStage(whichFlashPoint);
_movie.updateStage();
}
See also
stageToFlash()
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...