MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference page 460

Director scripting reference
Table of Contents

Advertisement

pointToItem()
Usage
-- Lingo syntax
spriteObjRef.pointToItem(pointToTranslate)
// JavaScript syntax
spriteObjRef.pointToItem(pointToTranslate);
Description
Function; returns an integer representing the item position in the text or field sprite at a specified
screen coordinate, or returns -1 if the point is not within the text. Items are separated by the
itemDelimiter
This function can be used to determine the item under the cursor.
Parameters
pointToTranslate
Example
These statements display the number of the item being clicked, as well as the text of the item, in
the Message window:
--Lingo syntax
property spriteNum
on mouseDown me
pointClicked = _mouse.mouseLoc
currentMember = sprite(spriteNum).member
itemNum = sprite(spriteNum).pointToItem(pointClicked)
itemText = currentMember.item[itemNum]
put("Clicked item" && itemNum & ", the text" && itemText)
end
// JavaScript syntax
function mouseDown() {
var pointClicked = _mouse.mouseLoc;
var currentMember = sprite(this.spriteNum).member;
var itemNum = sprite(this.spriteNum).pointToItem(pointClicked);
var itemText = currentMember.getProp("item",itemNum);
trace( "Clicked item " + itemNum + ", the text " + itemText);
}
See also
itemDelimiter, mouseLoc, pointToChar(), pointToWord(), pointToItem(),
pointToLine(),
460
Chapter 12: Methods
property, which is set to a comma by default.
Required. Specifies the screen coordinate to test.
pointToParagraph()

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Director mx 2004

Table of Contents