number

Typeproperty
DictionaryLCS
LibraryLiveCode Script
Syntax
set the number of <card> to <number>
get the number of <object>
Synonymsnum
Associationsstack, card, field, button, graphic, scrollbar, player, image
Summary

Specifies an object's position within a file, a card's position within a stack, or a control's layer on a card.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
set the number of this card to 1
if the number of this card is 1 then go last card
put the number of the last button into numberOfButtons
Values
NameTypeDescription
Value

The number of an object is a non-negative integer.
For all objects except cards, the number property is read-only and cannot be set.

RelatedProperty: substacks, layer
Message: nameChanged
Keyword: file, ninth, seconds, card, control, integer, home
Glossary: object, property, substack, main stack
Function: length
Command: move
Object: stack, card
Description

Use the number property to find out what layer a card is on, to find or change a card's position, or to refer to an object.

The number of a control is its layer on the card. Lower numbers are further back; higher numbers are farther forward. If you create several controls and don't change their layer order, the first control you created has the number 1 and the rest of the controls are numbered in the order of creation.

The number of a card specifies its position in the stack. When you open a stack without specifying a card, the card whose number is one appears first. Setting the number of a card moves it to the specified position in the stack. (Cards are the only objects whose number property can be set. )

The number of a main stack is always zero. The number of a substack is its creation order in the file, from 1 to the number of substacks.

You can refer to any object by specifying its number.

Tagsui