Lingo Dictionary > S > stageToFlash()

 

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

This handler checks to see if the mouse (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 mouse 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()