top

Usage

-- Lingo syntax
spriteObjRef.top

// JavaScript syntax
spriteObjRef.top;

Description

Sprite property; returns or sets the top vertical coordinate of the bounding rectangle of a sprite as the number of pixels from the upper left corner of the Stage. Read/write.

Example

This statement checks whether the top of sprite 3 is above the top of the Stage and calls the handler offTopEdge if it is:

-- Lingo syntax
if (sprite(3).top < 0) then
   offTopEdge()
end if

// JavaScript syntax
if (sprite(3).top < 0) {
   offTopEdge();
}

See also

bottom, height, left, locH, locV, right, Sprite, width